From 32924f8e366663f2a3edacfcce846e3b5bf7c71c Mon Sep 17 00:00:00 2001
From: xiaowang <2161656029@qq.com>
Date: Fri, 24 Jul 2026 17:20:44 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BA=97=E5=8A=A1=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
JY-Salon-WeChat/api/dashboard.js | 9 +
.../pages/profile-settings/index.wxml | 81 ++-
.../pages/profile-settings/index.wxss | 365 ++++++-------
JY-Salon-WeChat/pages/profile/index.js | 92 +++-
JY-Salon-WeChat/pages/profile/index.wxml | 77 ++-
JY-Salon-WeChat/pages/profile/index.wxss | 408 +++++++++-----
...26-07-24-salon-wechat-profile-ui-design.md | 40 ++
docs/项目变更记录.md | 513 +++++++++++++++++-
8 files changed, 1152 insertions(+), 433 deletions(-)
create mode 100644 JY-Salon-WeChat/api/dashboard.js
create mode 100644 docs/superpowers/specs/2026-07-24-salon-wechat-profile-ui-design.md
diff --git a/JY-Salon-WeChat/api/dashboard.js b/JY-Salon-WeChat/api/dashboard.js
new file mode 100644
index 00000000..90af8868
--- /dev/null
+++ b/JY-Salon-WeChat/api/dashboard.js
@@ -0,0 +1,9 @@
+const request = require('../utils/request')
+
+module.exports = {
+ stats() {
+ return request({
+ url: '/dashboard/stats'
+ })
+ }
+}
diff --git a/JY-Salon-WeChat/pages/profile-settings/index.wxml b/JY-Salon-WeChat/pages/profile-settings/index.wxml
index 5dc6208f..60d303fc 100644
--- a/JY-Salon-WeChat/pages/profile-settings/index.wxml
+++ b/JY-Salon-WeChat/pages/profile-settings/index.wxml
@@ -1,53 +1,26 @@
个人资料加载中
-
- 个人资料
- 把你的姓名、联系方式和头像整理成店内可识别的名片。
-
-
-
-
-
-
+
+
+
- 头像
-
- {{profileForm.nickname || userInfo.nickname || '个人头像'}}
- {{roleText}} · {{shopName}}
+ 头像
+
+
+ {{profileForm.nickname || userInfo.nickname || '个人资料'}}
+ {{roleText}}
+
+ {{shopName}}
+
-
-
-
-
+
-
-
- 登录账号
- {{userInfo.account || '未设置'}}
-
-
- 身份
- {{roleText}}
-
-
- 登录手机号
- {{userInfo.phone || '未绑定'}}
-
-
- 当前店铺
- {{shopName}}
-
-
-
-
-
+
+ 基础资料
昵称
@@ -61,13 +34,33 @@
- 签名
-
+ 个人简介
+
+
+
+
+
+ 账号信息
+
+ 登录账号
+ {{userInfo.account || '未设置'}}
+
+
+ 身份
+ {{roleText}}
+
+
+ 所属门店
+ {{shopName}}
+
+
+ 登录手机号
+ {{userInfo.phone || '未绑定'}}
-
+
diff --git a/JY-Salon-WeChat/pages/profile-settings/index.wxss b/JY-Salon-WeChat/pages/profile-settings/index.wxss
index 68109f01..53815a4e 100644
--- a/JY-Salon-WeChat/pages/profile-settings/index.wxss
+++ b/JY-Salon-WeChat/pages/profile-settings/index.wxss
@@ -1,103 +1,71 @@
.profile-settings-page {
+ min-height: 100vh;
+ padding: 20rpx 24rpx 196rpx;
background:
- linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(247, 240, 232, 0.96)),
- linear-gradient(135deg, rgba(89, 121, 102, 0.14), rgba(181, 134, 86, 0.12));
-}
-
-.page-heading {
- display: flex;
- flex-direction: column;
- gap: 8rpx;
- margin: 4rpx 0 22rpx;
-}
-
-.page-title {
- color: #2f2a25;
- font-size: 36rpx;
- font-weight: 900;
- line-height: 1.25;
-}
-
-.page-subtitle {
- color: #8a796a;
- font-size: 23rpx;
- line-height: 1.4;
+ linear-gradient(180deg, rgba(253, 249, 242, 0.98), rgba(248, 244, 237, 0.98)),
+ linear-gradient(135deg, rgba(116, 148, 130, 0.12), rgba(230, 205, 160, 0.1));
}
.loading-state {
- padding: 48rpx 24rpx;
+ padding: 56rpx 24rpx;
color: #7b7167;
text-align: center;
}
-.portrait-card {
- position: relative;
- display: flex;
- flex-direction: column;
- gap: 28rpx;
- min-width: 0;
- margin-bottom: 26rpx;
- padding: 30rpx;
+.profile-hero {
overflow: hidden;
- border-radius: 28rpx;
+ margin-bottom: 28rpx;
+ border-radius: 8px;
background:
- linear-gradient(135deg, rgba(55, 79, 66, 0.96), rgba(175, 126, 83, 0.94)),
- radial-gradient(circle at 18% 18%, rgba(255, 246, 224, 0.3), transparent 38%);
- box-shadow: 0 22rpx 46rpx rgba(83, 64, 44, 0.18);
+ radial-gradient(circle at 92% 4%, rgba(255, 255, 255, 0.72), transparent 32%),
+ linear-gradient(135deg, #eef8eb, #fffaf2);
+ box-shadow: 0 16rpx 40rpx rgba(77, 91, 72, 0.1);
}
-.portrait-glow {
- position: absolute;
- top: -82rpx;
- right: -72rpx;
- width: 220rpx;
- height: 220rpx;
- border: 1rpx solid rgba(255, 251, 238, 0.28);
- border-radius: 50%;
-}
-
-.portrait-main {
- position: relative;
- z-index: 1;
+.hero-main {
display: flex;
align-items: center;
+ gap: 26rpx;
min-width: 0;
- gap: 22rpx;
+ padding: 42rpx 34rpx 30rpx;
}
-.portrait-avatar {
+.hero-avatar {
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
- width: 132rpx;
- height: 132rpx;
+ width: 138rpx;
+ height: 138rpx;
overflow: hidden;
- border: 4rpx solid rgba(255, 253, 248, 0.78);
+ border: 4rpx solid rgba(255, 255, 255, 0.86);
border-radius: 50%;
- background: rgba(255, 253, 248, 0.18);
- color: #fffdf8;
- font-size: 28rpx;
+ background: #d8e8d9;
+ color: #5a8d68;
+ font-size: 26rpx;
font-weight: 900;
- box-shadow: 0 16rpx 34rpx rgba(32, 25, 18, 0.18);
+ box-shadow: 0 12rpx 28rpx rgba(76, 105, 82, 0.14);
}
-.portrait-avatar image {
+.hero-avatar image {
width: 100%;
height: 100%;
}
-.portrait-empty {
- background: rgba(255, 253, 248, 0.2);
-}
-
-.portrait-copy {
+.hero-copy {
+ flex: 1;
min-width: 0;
- color: #fffdf8;
}
-.portrait-name,
-.portrait-desc {
+.hero-title-row {
+ display: flex;
+ align-items: center;
+ gap: 14rpx;
+ min-width: 0;
+}
+
+.hero-title,
+.hero-shop {
display: block;
min-width: 0;
overflow: hidden;
@@ -105,191 +73,178 @@
white-space: nowrap;
}
-.portrait-name {
- font-size: 38rpx;
+.hero-title {
+ color: #25211d;
+ font-size: 34rpx;
font-weight: 900;
- line-height: 1.25;
+ line-height: 1.2;
}
-.portrait-desc {
- margin-top: 10rpx;
- font-size: 24rpx;
+.role-badge {
+ flex: 0 0 auto;
+ padding: 6rpx 16rpx;
+ border-radius: 999rpx;
+ background: #dcefe0;
+ color: #4e8a61;
+ font-size: 21rpx;
+ font-weight: 900;
+ line-height: 1.2;
+}
+
+.hero-shop {
+ margin-top: 12rpx;
+ color: #67615a;
+ font-size: 26rpx;
font-weight: 700;
- line-height: 1.4;
- opacity: 0.84;
+ line-height: 1.2;
}
-.portrait-actions {
- position: relative;
- z-index: 1;
- display: flex;
- flex-wrap: wrap;
- gap: 14rpx;
- width: 100%;
- min-width: 0;
+.avatar-change-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: auto;
+ min-width: 150rpx;
+ min-height: 46rpx;
+ margin-top: 18rpx;
+ padding: 0 18rpx;
+ border-radius: 999rpx;
+ background: #dcefe0;
+ color: #4e8a61;
+ font-size: 22rpx;
+ font-weight: 900;
}
-.avatar-btn,
.avatar-remove {
display: flex;
align-items: center;
justify-content: center;
- flex: 1 1 220rpx;
- width: auto;
- max-width: 100%;
- min-height: 68rpx;
- padding: 0 24rpx;
- border-radius: 20rpx;
+ width: 100%;
+ min-height: 74rpx;
+ border-top: 1rpx solid rgba(103, 131, 105, 0.1);
+ background: rgba(255, 255, 255, 0.56);
+ color: #9a6f62;
font-size: 25rpx;
+ font-weight: 800;
+}
+
+.info-card {
+ overflow: hidden;
+ margin-bottom: 28rpx;
+ padding-top: 20rpx;
+ border-radius: 8px;
+ background: rgba(255, 255, 255, 0.9);
+ box-shadow: 0 12rpx 30rpx rgba(65, 54, 42, 0.06);
+}
+
+.card-title {
+ display: block;
+ padding: 0 28rpx 14rpx;
+ color: #302b26;
+ font-size: 28rpx;
font-weight: 900;
line-height: 1.2;
}
-.avatar-btn {
- background: #fff8ed;
- color: #6d4d35;
+.profile-field,
+.info-row {
+ display: flex;
+ align-items: center;
+ min-height: 96rpx;
+ padding: 0 28rpx;
+ border-top: 1rpx solid #eee8df;
}
-.avatar-remove {
- flex-grow: 0;
- min-width: 150rpx;
- background: rgba(255, 253, 248, 0.18);
- color: #fffdf8;
+.profile-field {
+ gap: 20rpx;
}
-.info-grid {
- display: grid;
- grid-template-columns: repeat(2, minmax(0, 1fr));
- gap: 16rpx;
- margin-bottom: 24rpx;
-}
-
-.info-tile {
- min-width: 0;
- padding: 18rpx;
- border: 1rpx solid rgba(50, 43, 34, 0.06);
- border-radius: 20rpx;
- background: #fffdf8;
- box-shadow: 0 10rpx 28rpx rgba(58, 48, 34, 0.05);
-}
-
-.info-tile text,
-.info-tile view {
- display: block;
- min-width: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.info-tile text {
- color: #8a7f75;
- font-size: 22rpx;
+.field-label,
+.row-label {
+ flex: 0 0 auto;
+ width: 178rpx;
+ color: #443e38;
+ font-size: 26rpx;
font-weight: 800;
line-height: 1.2;
}
-.info-tile view {
- margin-top: 10rpx;
- color: #2c2722;
- font-size: 25rpx;
- font-weight: 900;
- line-height: 1.2;
-}
-
-.form-card {
- padding: 12rpx 0;
- overflow: hidden;
-}
-
-.form-header {
- display: flex;
- flex-direction: column;
- gap: 6rpx;
- padding: 26rpx 26rpx 8rpx;
-}
-
-.form-kicker {
- color: #92734f;
- font-size: 22rpx;
- font-weight: 900;
- line-height: 1.2;
-}
-
-.form-title {
- color: #8d8175;
- font-size: 23rpx;
- line-height: 1.35;
-}
-
-.profile-field {
- display: flex;
- flex-direction: column;
- align-items: stretch;
- gap: 12rpx;
- min-height: 130rpx;
- padding: 20rpx 24rpx;
- border-bottom: 1rpx solid #eee8df;
-}
-
-.profile-field:last-child {
- border-bottom: 0;
-}
-
-.profile-field .field-label {
- width: auto;
- color: #62574d;
- font-size: 25rpx;
- font-weight: 900;
- line-height: 1.2;
-}
-
.profile-field input,
-.profile-field textarea {
- width: 100%;
- min-height: 76rpx;
- padding: 0 22rpx;
- border: 1rpx solid #eadfd2;
- border-radius: 18rpx;
- background: #fff8f2;
- color: #2d2722;
- font-size: 28rpx;
- line-height: 76rpx;
+.profile-field textarea,
+.row-value {
+ flex: 1;
+ min-width: 0;
+ color: #302b26;
+ font-size: 27rpx;
+ line-height: 1.35;
+ text-align: right;
+}
+
+.profile-field input {
+ min-height: 80rpx;
}
.profile-field textarea {
height: 150rpx;
- padding-top: 18rpx;
- padding-bottom: 18rpx;
- line-height: 1.5;
+ padding: 22rpx 0;
}
.signature-field {
- min-height: 218rpx;
+ align-items: flex-start;
+ min-height: 164rpx;
+ padding-top: 12rpx;
+ padding-bottom: 12rpx;
+}
+
+.row-value {
+ display: block;
+ overflow: hidden;
+ color: #827a72;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.fixed-bottom {
+ padding: 18rpx 34rpx calc(18rpx + env(safe-area-inset-bottom));
+}
+
+.primary-btn {
+ min-height: 82rpx;
+ border-radius: 8px;
+ background: #4f8b63;
+ box-shadow: 0 14rpx 28rpx rgba(79, 139, 99, 0.26);
}
@media (max-width: 340px) {
- .portrait-main {
+ .hero-main {
align-items: flex-start;
+ gap: 18rpx;
+ padding: 32rpx 24rpx 26rpx;
}
- .portrait-avatar {
+ .hero-avatar {
width: 112rpx;
height: 112rpx;
}
- .portrait-actions {
+ .profile-field,
+ .info-row {
+ align-items: flex-start;
flex-direction: column;
+ gap: 12rpx;
+ padding-top: 20rpx;
+ padding-bottom: 20rpx;
}
- .avatar-btn,
- .avatar-remove {
- flex: 0 0 auto;
+ .field-label,
+ .row-label {
+ width: auto;
+ }
+
+ .profile-field input,
+ .profile-field textarea,
+ .row-value {
width: 100%;
- min-width: 0;
- }
-
- .info-grid {
- grid-template-columns: 1fr;
+ text-align: left;
}
}
diff --git a/JY-Salon-WeChat/pages/profile/index.js b/JY-Salon-WeChat/pages/profile/index.js
index 1359d0b1..86154653 100644
--- a/JY-Salon-WeChat/pages/profile/index.js
+++ b/JY-Salon-WeChat/pages/profile/index.js
@@ -1,6 +1,7 @@
const { BRAND_CONFIG } = require('../../utils/config')
const userApi = require('../../api/user')
const shopApi = require('../../api/shop')
+const dashboardApi = require('../../api/dashboard')
const authApi = require('../../api/auth')
const auth = require('../../utils/auth')
@@ -34,21 +35,74 @@ function resolveShopCoverImage(settings) {
return String(settings.coverImageUrls[0] || '').trim()
}
+function formatCount(value) {
+ const count = Number(value)
+ if (!Number.isFinite(count)) return '--'
+ return String(Math.max(0, Math.trunc(count)))
+}
+
+function formatMoney(value) {
+ const amount = Number(value)
+ if (!Number.isFinite(amount)) return '--'
+ return `¥${amount.toFixed(2).replace(/\.00$/, '')}`
+}
+
+function resolveTodayAppointments(stats) {
+ return stats.todayAppointments || stats.todayAppointmentCount || stats.todayServiceCount || stats.todayServices || stats.todayOrders
+}
+
+function buildDashboardStats(stats) {
+ const data = stats || {}
+ return [
+ { mark: '今', label: '今日预约', value: formatCount(resolveTodayAppointments(data)), unit: '单' },
+ { mark: '单', label: '今日订单', value: formatCount(data.todayOrders), unit: '单' },
+ { mark: '¥', label: '今日收入', value: formatMoney(data.todayOrderAmount), unit: '' }
+ ]
+}
+
+function resolveBusinessStatus(settings) {
+ if (Number(settings.status) === 0) {
+ return { text: '已停用', className: 'closed' }
+ }
+ if (settings.authorizationExpired) {
+ return { text: '授权到期', className: 'warning' }
+ }
+ return { text: '营业中', className: 'open' }
+}
+
+function resolveBusinessHours(settings) {
+ const businessHours = String(settings.businessHours || '').trim()
+ if (businessHours) return `今日营业 ${businessHours}`
+ const startTime = String(settings.startTime || '').slice(0, 5)
+ const endTime = String(settings.endTime || '').slice(0, 5)
+ if (startTime && endTime) return `今日营业 ${startTime} - ${endTime}`
+ return '营业时间未设置'
+}
+
Page({
data: {
shopName: BRAND_CONFIG.defaultShopName,
shopCoverImage: '',
phone: '店长端',
roleText: '管理端',
+ businessStatusText: '营业中',
+ businessStatusClass: 'open',
+ businessHoursText: '营业时间未设置',
+ dashboardStats: buildDashboardStats({}),
userInfo: {},
loggingOut: false,
- menus: [
- { title: '个人信息', url: '/pages/profile-settings/index' },
- { title: '店铺设置', url: '/pages/shop-settings/index' },
- { title: '数据导出', url: '/pages/export/index' },
- { title: '修改密码', url: '/pages/password/index' },
- { title: '关于系统', url: '/pages/about/index' },
- { title: '退出登录', action: 'logout', danger: true }
+ managementMenus: [
+ { mark: '店', title: '我的店铺', desc: '店铺信息、营业设置等', url: '/pages/shop-settings/index' },
+ { mark: '员', title: '员工管理', desc: '员工信息、排班与权限', url: '/pages/employees/index' },
+ { mark: '会', title: '会员管理', desc: '客户管理、会员等级', url: '/pages/customers/index' },
+ { mark: '数', title: '经营数据', desc: '营业统计、数据导出', url: '/pages/export/index' }
+ ],
+ settingMenus: [
+ { mark: '人', title: '个人资料', desc: '头像、昵称、联系方式等', url: '/pages/profile-settings/index' },
+ { mark: '安', title: '账号与安全', desc: '修改密码、绑定手机号等', url: '/pages/password/index' },
+ { mark: '知', title: '消息通知', desc: '系统通知与消息偏好', url: '', disabled: true },
+ { mark: '?', title: '帮助中心', desc: '使用帮助与常见问题', url: '/pages/about/index' },
+ { mark: '关', title: '关于甲屿店务', desc: '当前版本 1.2.0', url: '/pages/about/index' }
]
},
@@ -56,6 +110,7 @@ Page({
this.refreshFromSession()
this.loadShopHeader()
this.loadProfile()
+ this.loadDashboardStats()
},
refreshFromSession() {
@@ -80,24 +135,43 @@ Page({
const app = getApp()
const shopName = settings.shopName || settings.name || app.globalData.shopName || BRAND_CONFIG.appName
const shopCoverImage = resolveShopCoverImage(settings)
+ const status = resolveBusinessStatus(settings || {})
app.globalData.shopName = shopName
app.globalData.shopCoverImage = shopCoverImage
this.setData({
shopName,
- shopCoverImage
+ shopCoverImage,
+ businessStatusText: status.text,
+ businessStatusClass: status.className,
+ businessHoursText: resolveBusinessHours(settings || {})
})
} catch (error) {
wx.showToast({ title: error.message || '店铺信息加载失败', icon: 'none' })
}
},
+ async loadDashboardStats() {
+ try {
+ const stats = await dashboardApi.stats()
+ this.setData({ dashboardStats: buildDashboardStats(stats || {}) })
+ } catch (error) {
+ this.setData({ dashboardStats: buildDashboardStats({}) })
+ wx.showToast({ title: error.message || '经营数据加载失败', icon: 'none' })
+ }
+ },
+
go(event) {
const action = event.currentTarget.dataset.action
if (action === 'logout') {
this.confirmLogout()
return
}
- wx.navigateTo({ url: event.currentTarget.dataset.url })
+ const url = event.currentTarget.dataset.url
+ if (!url) {
+ wx.showToast({ title: '功能即将开放', icon: 'none' })
+ return
+ }
+ wx.navigateTo({ url })
},
confirmLogout() {
diff --git a/JY-Salon-WeChat/pages/profile/index.wxml b/JY-Salon-WeChat/pages/profile/index.wxml
index ce58d5dd..7b071f2d 100644
--- a/JY-Salon-WeChat/pages/profile/index.wxml
+++ b/JY-Salon-WeChat/pages/profile/index.wxml
@@ -1,45 +1,62 @@
-
-
-
-
+
+
+
+
- 我
-
-
- {{userInfo.nickname || shopName}}
+ 我
+
+
+ {{userInfo.nickname || shopName}}
{{roleText}}
-
- 登录账号
- {{userInfo.account || '未设置'}}
+
+ {{shopName}}
+ ›
-
- 手机号
- {{userInfo.phone || userInfo.contactPhone || phone || '未绑定'}}
+
+ {{businessStatusText}}
+ {{businessHoursText}}
-
- 当前所属店铺
- {{shopName}}
-
-
-
- 身份
- {{roleText}}
-
-
- 店铺
- {{shopName}}
+
+
+ {{item.mark}}
+ {{item.label}}
+ {{item.value}}
+ {{item.unit}}
-