完善医疗项目页面

This commit is contained in:
2026-04-10 10:02:10 +08:00
parent 3304b98bee
commit d5bd898896
186 changed files with 1059 additions and 247 deletions

View File

@@ -156,15 +156,18 @@
async loadLevels() {
const res = await supa.from('ml_member_levels').select('*').order('level_rank', { ascending: true }).execute()
if (res.data != null) {
this.levels = (res.data as any[]).map((item: any) => {
const obj = item as UTSJSONObject
return {
const raw = res.data as any[]
const levels: MemberLevel[] = []
for (let i = 0; i < raw.length; i++) {
const obj = raw[i] as UTSJSONObject
levels.push({
id: obj.getString('id') || '',
name: obj.getString('name') || '',
discount_rate: obj.getNumber('discount_rate') || 1.0,
level_rank: obj.getNumber('level_rank') || 0
} as MemberLevel
})
} as MemberLevel)
}
this.levels = levels
}
},
async loadUsers() {
@@ -467,66 +470,415 @@
</script>
<style>
.members-page { background-color: #f8f9fa; min-height: 100vh; }
/* ===== tabs 横排 ===== */
.tabs { display: flex; flex-direction: row; background: #fff; padding: 20rpx 0; border-bottom: 1rpx solid #eee; }
.tab { flex: 1; text-align: center; font-size: 28rpx; color: #666; }
.tab.active { color: rgb(66, 121, 240); font-weight: bold; }
.members-page {
display: flex;
flex-direction: column;
background-color: #f8f9fa;
min-height: 100vh;
box-sizing: border-box;
}
.list-container { padding: 20rpx; }
.section-card { background: #fff; border-radius: 16rpx; padding: 30rpx; }
/* ===== 卡片头部横排 ===== */
.card-header { display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-bottom: 30rpx; }
.card-title { font-size: 32rpx; font-weight: bold; }
.add-btn { color: rgb(66, 121, 240); font-size: 26rpx; }
.tabs {
display: flex;
flex-direction: row;
align-items: center;
background: #ffffff;
padding: 0;
border-bottom: 1rpx solid #eeeeee;
box-sizing: border-box;
}
/* ===== 等级列表项横排(左名称+折扣 / 右操作)===== */
.level-item { display: flex; flex-direction: row; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #f5f5f5; padding: 20rpx 0; }
.level-info { display: flex; flex-direction: column; flex: 1; }
.level-name { font-size: 30rpx; color: #333; margin-bottom: 4rpx; }
.level-rate { font-size: 24rpx; color: #FF9500; }
.level-actions { display: flex; flex-direction: row; align-items: center; }
.action-edit { color: rgb(66, 121, 240); font-size: 26rpx; margin-right: 24rpx; }
.action-del { color: #FF3B30; font-size: 26rpx; }
.tab {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: 88rpx;
font-size: 28rpx;
color: #666666;
position: relative;
box-sizing: border-box;
}
.search-bar { display: flex; flex-direction: row; align-items: center; padding: 20rpx; background: #fff; margin-bottom: 20rpx; border-radius: 12rpx; }
.search-input { flex: 1; height: 72rpx; background: #f5f5f5; border-radius: 36rpx; padding: 0 30rpx; font-size: 26rpx; }
.search-btn { margin-left: 20rpx; color: rgb(66, 121, 240); line-height: 72rpx; font-size: 28rpx; }
.tab.active {
color: rgb(66, 121, 240);
font-weight: bold;
}
/* ===== 用户列表项横排(左头像 / 中信息 / 右操作)===== */
.user-item { display: flex; flex-direction: row; align-items: center; background: #fff; padding: 24rpx; border-radius: 16rpx; margin-bottom: 20rpx; }
.user-avatar { width: 90rpx; height: 90rpx; border-radius: 45rpx; background: #eee; flex-shrink: 0; }
.user-info { flex: 1; margin-left: 24rpx; display: flex; flex-direction: column; }
/* 姓名行:昵称 + 等级标签横排 */
.user-title-row { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; margin-bottom: 4rpx; }
.user-name { font-size: 30rpx; font-weight: bold; color: #333; margin-right: 10rpx; }
.user-email { font-size: 22rpx; color: #999; margin-bottom: 4rpx; }
.user-phone { font-size: 24rpx; color: #999; }
.user-tier-tag { background: #FF9500; color: #fff; font-size: 20rpx; padding: 2rpx 12rpx; border-radius: 4rpx; }
/* ===== 操作按钮区横排 ===== */
.user-actions { display: flex; flex-direction: row; align-items: center; flex-shrink: 0; margin-left: 16rpx; }
.action-set { font-size: 24rpx; color: rgb(66, 121, 240); padding: 10rpx 16rpx; background-color: #e8f0fe; border-radius: 8rpx; }
.action-set.discount-btn { color: #FF9800; background-color: #FFF8E1; margin-left: 12rpx; }
.tab.active::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 44rpx;
height: 4rpx;
background: rgb(66, 121, 240);
border-radius: 2rpx;
}
/* 弹窗样式 */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; flex-direction: row; align-items: center; justify-content: center; z-index: 999; }
.modal-content { background: #fff; width: 600rpx; border-radius: 24rpx; padding: 40rpx; }
.modal-title { text-align: center; font-size: 34rpx; font-weight: bold; margin-bottom: 30rpx; }
.form-item { margin-bottom: 30rpx; }
.label { font-size: 26rpx; color: #666; margin-bottom: 12rpx; display: block; }
.input { background: #f5f5f5; height: 80rpx; border-radius: 12rpx; padding: 0 20rpx; font-size: 28rpx; }
/* ===== modal 按钮横排 ===== */
.modal-btns { display: flex; flex-direction: row; justify-content: flex-end; margin-top: 40rpx; }
.btn { padding: 16rpx 40rpx; border-radius: 12rpx; font-size: 28rpx; margin-left: 20rpx; }
.btn.cancel { background: #eee; color: #666; }
.btn.confirm { background: rgb(66, 121, 240); color: #fff; }
.list-container {
flex: 1;
height: calc(100vh - 176rpx);
padding: 20rpx;
box-sizing: border-box;
}
/* ===== 等级选择横向排列 ===== */
.tier-options { display: flex; flex-direction: row; flex-wrap: wrap; }
.tier-option { padding: 16rpx 30rpx; background: #f5f5f5; margin: 10rpx; border-radius: 36rpx; font-size: 26rpx; }
.tier-option.selected { background: rgb(66, 121, 240); color: #fff; }
.section-card {
background: #ffffff;
border-radius: 16rpx;
padding: 30rpx;
box-sizing: border-box;
}
.card-header {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-bottom: 30rpx;
box-sizing: border-box;
}
.card-title {
font-size: 32rpx;
font-weight: bold;
color: #333333;
line-height: 1.4;
}
.add-btn {
font-size: 26rpx;
color: rgb(66, 121, 240);
line-height: 1.4;
}
.level-list {
display: flex;
flex-direction: column;
}
.level-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 24rpx 0;
border-bottom: 1rpx solid #f5f5f5;
box-sizing: border-box;
}
.level-info {
flex: 1;
display: flex;
flex-direction: column;
margin-right: 20rpx;
box-sizing: border-box;
}
.level-name {
font-size: 30rpx;
color: #333333;
font-weight: 500;
line-height: 1.4;
margin-bottom: 8rpx;
}
.level-rate {
font-size: 24rpx;
color: #ff9500;
line-height: 1.4;
}
.level-actions {
display: flex;
flex-direction: row;
align-items: center;
flex-shrink: 0;
}
.action-edit,
.action-del {
font-size: 24rpx;
line-height: 1.4;
padding: 8rpx 0;
}
.action-edit {
color: rgb(66, 121, 240);
margin-right: 24rpx;
}
.action-del {
color: #ff3b30;
}
.user-list {
display: flex;
flex-direction: column;
}
.empty-tip {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
min-height: 220rpx;
background: #ffffff;
border-radius: 16rpx;
font-size: 28rpx;
color: #999999;
box-sizing: border-box;
}
.user-item {
display: flex;
flex-direction: row;
align-items: center;
background: #ffffff;
padding: 24rpx;
border-radius: 16rpx;
margin-bottom: 20rpx;
box-sizing: border-box;
}
.user-avatar {
width: 90rpx;
height: 90rpx;
border-radius: 45rpx;
background: #eeeeee;
flex-shrink: 0;
}
.user-info {
flex: 1;
display: flex;
flex-direction: column;
margin-left: 24rpx;
margin-right: 20rpx;
box-sizing: border-box;
}
.user-title-row {
display: flex;
flex-direction: row;
align-items: center;
flex-wrap: wrap;
margin-bottom: 8rpx;
}
.user-name {
font-size: 30rpx;
font-weight: bold;
color: #333333;
line-height: 1.4;
margin-right: 12rpx;
}
.user-tier-tag {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: 36rpx;
padding: 0 14rpx;
background: #ff9500;
color: #ffffff;
font-size: 20rpx;
border-radius: 18rpx;
line-height: 1;
box-sizing: border-box;
margin-top: 4rpx;
}
.user-email {
font-size: 24rpx;
color: #666666;
line-height: 1.4;
margin-bottom: 6rpx;
}
.user-phone {
font-size: 24rpx;
color: #999999;
line-height: 1.4;
}
.user-actions {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
flex-wrap: wrap;
flex-shrink: 0;
}
.action-set {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: 60rpx;
padding: 0 20rpx;
font-size: 24rpx;
color: rgb(66, 121, 240);
background-color: #e8f0fe;
border-radius: 30rpx;
box-sizing: border-box;
margin-left: 12rpx;
margin-top: 8rpx;
}
.action-set.discount-btn {
color: #ff9800;
background-color: #fff8e1;
}
.search-bar {
display: flex;
flex-direction: row;
align-items: center;
padding: 20rpx;
background: #ffffff;
margin-bottom: 20rpx;
border-radius: 12rpx;
box-sizing: border-box;
}
.search-input {
flex: 1;
height: 72rpx;
background: #f5f5f5;
border-radius: 36rpx;
padding: 0 30rpx;
font-size: 26rpx;
box-sizing: border-box;
}
.search-btn {
margin-left: 20rpx;
height: 72rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
color: rgb(66, 121, 240);
font-size: 28rpx;
}
.modal {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
z-index: 999;
padding: 30rpx;
box-sizing: border-box;
}
.modal-content {
width: 600rpx;
max-width: 100%;
background: #ffffff;
border-radius: 24rpx;
padding: 40rpx;
box-sizing: border-box;
}
.modal-title {
text-align: center;
font-size: 34rpx;
font-weight: bold;
color: #333333;
line-height: 1.4;
margin-bottom: 30rpx;
}
.form-item {
display: flex;
flex-direction: column;
margin-bottom: 30rpx;
}
.label {
font-size: 26rpx;
color: #666666;
line-height: 1.4;
margin-bottom: 12rpx;
}
.input {
background: #f5f5f5;
height: 80rpx;
border-radius: 12rpx;
padding: 0 20rpx;
font-size: 28rpx;
box-sizing: border-box;
}
.modal-btns {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
margin-top: 40rpx;
}
.btn {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
min-width: 160rpx;
height: 76rpx;
padding: 0 32rpx;
border-radius: 12rpx;
font-size: 28rpx;
box-sizing: border-box;
margin-left: 20rpx;
}
.btn.cancel {
background: #eeeeee;
color: #666666;
}
.btn.confirm {
background: rgb(66, 121, 240);
color: #ffffff;
}
.tier-options {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin: -10rpx;
}
.tier-option {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding: 16rpx 30rpx;
background: #f5f5f5;
margin: 10rpx;
border-radius: 36rpx;
font-size: 26rpx;
color: #333333;
box-sizing: border-box;
}
.tier-option.selected {
background: rgb(66, 121, 240);
color: #ffffff;
}
</style>