- 🔥 完全重写 .cursor/cursorrules-mobile.md (940行) * 基于实际mobile工程Vue 3.4.21+uniapp+uview-plus架构 * 移除所有JeeSite相关内容,精准匹配实际项目 * 新增11个完整章节:技术栈、项目结构、页面开发、组件规范等 - 📚 创建完整规范文档 docs/开发文档/移动端开发规范总结.md (800+行) * 涵盖从项目架构到部署的全流程指导 * 提供可直接使用的页面和组件模板 * 包含现代CSS变量设计系统和用户体验优化 - 🔄 同步更新主配置文件 .cursorrules * 更新移动端技术栈描述 * 调整为Vue 3.4.21+uniapp+uview-plus 3.4.45架构 - 📝 完善变更记录 * 详细记录规范更新背景和技术价值 * 为后续维护提供完整历史记录 核心价值:解决规范与实际项目不匹配问题,为Cursor AI提供准确的移动端开发上下文,确保生成代码完全符合实际项目架构。
104 lines
2.2 KiB
Vue
104 lines
2.2 KiB
Vue
<template>
|
|
<view class="card touchable" @click="handleClick">
|
|
<view v-if="title || $slots.header" class="card-header">
|
|
<slot name="header">
|
|
<text class="card-title">{{ title }}</text>
|
|
<slot name="action"></slot>
|
|
</slot>
|
|
</view>
|
|
<view class="card-content" :class="{ 'no-padding': noPadding }">
|
|
<slot></slot>
|
|
</view>
|
|
<view v-if="$slots.footer" class="card-footer">
|
|
<slot name="footer"></slot>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'Card',
|
|
props: {
|
|
title: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
noPadding: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
clickable: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
methods: {
|
|
handleClick() {
|
|
if (this.clickable) {
|
|
this.$emit('click');
|
|
uni.vibrateShort();
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.card {
|
|
background: $uni-bg-color;
|
|
border-radius: $uni-border-radius-lg;
|
|
box-shadow: $uni-shadow;
|
|
transition: $uni-transition;
|
|
overflow: hidden;
|
|
margin: $uni-spacing-col-lg;
|
|
|
|
&:hover {
|
|
box-shadow: $uni-shadow-hover;
|
|
transform: translateY(-2px);
|
|
}
|
|
}
|
|
|
|
.card-header {
|
|
padding: $uni-spacing-col-lg $uni-spacing-row-xl;
|
|
border-bottom: 1px solid $uni-border-color;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.card-title {
|
|
font-size: $uni-font-size-lg;
|
|
font-weight: 600;
|
|
color: $uni-text-color;
|
|
margin: 0;
|
|
}
|
|
|
|
.card-content {
|
|
padding: $uni-spacing-col-xl;
|
|
|
|
&.no-padding {
|
|
padding: 0;
|
|
}
|
|
}
|
|
|
|
.card-footer {
|
|
padding: $uni-spacing-col-lg $uni-spacing-row-xl;
|
|
border-top: 1px solid $uni-border-color;
|
|
background: rgba(0, 0, 0, 0.02);
|
|
}
|
|
|
|
/* 响应式设计 */
|
|
@media (max-width: 375px) {
|
|
.card {
|
|
margin: $uni-spacing-col-base;
|
|
}
|
|
|
|
.card-header,
|
|
.card-content,
|
|
.card-footer {
|
|
padding-left: $uni-spacing-row-lg;
|
|
padding-right: $uni-spacing-row-lg;
|
|
}
|
|
}
|
|
</style>
|