修复我的页身份和规划日周视图

This commit is contained in:
2026-06-27 01:46:44 +08:00
parent 223cd755a2
commit 28219e5fc2
7 changed files with 107 additions and 16 deletions
+12 -1
View File
@@ -1,9 +1,18 @@
const { BRAND_CONFIG } = require('../../utils/config')
function resolveRoleText(type) {
const role = Number(type)
if (role === 2) return '店长'
if (role === 3) return '美甲师'
if (role === 4) return '管理员'
return '管理端'
}
Page({
data: {
shopName: BRAND_CONFIG.defaultShopName,
phone: '店长端',
roleText: '管理端',
menus: [
{ title: '店铺设置', url: '/pages/shop-settings/index' },
{ title: '数据导出', url: '/pages/export/index' },
@@ -14,9 +23,11 @@ Page({
onShow() {
const app = getApp()
const userInfo = app.globalData.userInfo || {}
this.setData({
shopName: app.globalData.shopName || BRAND_CONFIG.appName,
phone: (app.globalData.userInfo && (app.globalData.userInfo.phone || app.globalData.userInfo.account)) || '店长端'
phone: userInfo.phone || userInfo.account || '店长端',
roleText: resolveRoleText(userInfo.type)
})
},
+7 -4
View File
@@ -1,10 +1,13 @@
<view class="page">
<view class="card profile-card">
<view class="shop-logo">指</view>
<view>
<text class="shop-name">{{shopName}}</text>
<text class="phone">{{phone}}</text>
<view class="profile-main">
<view class="shop-logo">指</view>
<view class="profile-copy">
<text class="shop-name">{{shopName}}</text>
<text class="phone">{{phone}}</text>
</view>
</view>
<text class="role-badge">{{roleText}}</text>
</view>
<view class="section menu-list card">
@@ -1,14 +1,27 @@
.profile-card {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
padding: 28rpx;
}
.profile-main {
display: flex;
align-items: center;
min-width: 0;
gap: 20rpx;
}
.profile-copy {
min-width: 0;
}
.shop-logo {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 96rpx;
height: 96rpx;
border-radius: 24rpx;
@@ -26,6 +39,9 @@
.shop-name {
font-size: 34rpx;
font-weight: 800;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.phone {
@@ -34,6 +50,17 @@
font-size: 24rpx;
}
.role-badge {
flex-shrink: 0;
padding: 8rpx 18rpx;
border-radius: 999rpx;
background: #e5eee9;
color: #4e7165;
font-size: 23rpx;
font-weight: 800;
line-height: 1.2;
}
.menu-list {
overflow: hidden;
}