refactor: 组件就近迁移、操作菜单组件化并统一页面命名
- 组件文件统一 PascalCase 并就近迁入所属目录 - 操作菜单抽为 ActionSheet 组件,危险操作确认拆为 useConfirmAction - 导航栏测量拆为 useNavbarMetrics 并收缩对外接口 - 页面方法按动词约定重命名,show 前缀与 handle 误用一并修正 - 通知与菜单接口类型改用字面量联合并修正取值注释 - 多行空壳注释收回单行
This commit is contained in:
1 parent
1e3954ce0c
commit
cb1a1e349f
63 files changed
+1653
-1423
No files matched your search
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<view class="quick-actions">
|
||||
<view class="quick-card" @click="emit('profile')">
|
||||
<view class="quick-card__icon quick-card__icon--primary">
|
||||
<wd-icon name="user" size="28" color="var(--color-primary)" />
|
||||
</view>
|
||||
<view class="quick-card__body">
|
||||
<text class="quick-card__title">我的资料</text>
|
||||
<text class="quick-card__desc">修改个人信息</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="quick-card" @click="emit('account')">
|
||||
<view class="quick-card__icon quick-card__icon--success">
|
||||
<wd-icon name="safe" size="28" color="var(--color-success)" />
|
||||
</view>
|
||||
<view class="quick-card__body">
|
||||
<text class="quick-card__title">账号安全</text>
|
||||
<text class="quick-card__desc">修改密码 / 账号绑定</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
/** profile / account:只上报点击意图,登录校验与跳转由父级决定 */
|
||||
const emit = defineEmits<{
|
||||
profile: [];
|
||||
account: [];
|
||||
}>();
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.quick-actions {
|
||||
position: relative;
|
||||
z-index: var(--z-sticky);
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 20rpx;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.quick-card {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
align-items: center;
|
||||
padding: 28rpx 24rpx;
|
||||
background: var(--color-bg-card);
|
||||
border-radius: 24rpx;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.quick-card:active {
|
||||
box-shadow: var(--shadow-sm);
|
||||
transform: scale(0.96);
|
||||
}
|
||||
|
||||
.quick-card__icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 84rpx;
|
||||
height: 84rpx;
|
||||
border-radius: 22rpx;
|
||||
|
||||
&--primary {
|
||||
background: var(--color-primary-soft);
|
||||
}
|
||||
|
||||
&--success {
|
||||
background: var(--color-success-light);
|
||||
}
|
||||
}
|
||||
|
||||
.quick-card__body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.quick-card__title {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
line-height: 1.35;
|
||||
color: var(--color-text);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.quick-card__desc {
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
overflow: hidden;
|
||||
font-size: 22rpx;
|
||||
line-height: 1.6;
|
||||
color: var(--color-text-secondary);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user