feat: 移动端开发规范重大更新

- 🔥 完全重写 .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提供准确的移动端开发上下文,确保生成代码完全符合实际项目架构。
This commit is contained in:
zlwu committed 2025-07-04 15:51:33 +08:00
1 parent e8ece1b612
commit 28232d5d46
131 files changed
+17170 -5479

No files matched your search

+474
View File
@@ -0,0 +1,474 @@
<template>
<view class="page-container">
<!-- 自定义导航栏 -->
<NavBar title="办公中心" :show-search="true" @search="handleSearch" />
<!-- 主要内容区域 -->
<scroll-view class="main-content" scroll-y enhanced :show-scrollbar="false">
<!-- 搜索栏 -->
<view class="search-section">
<view class="search-bar" @click="focusSearch">
<text class="search-icon">🔍</text>
<input
class="search-input"
placeholder="搜索服务..."
v-model="searchQuery"
@input="handleSearchInput"
@confirm="handleSearchConfirm"
:focus="searchFocused"
/>
</view>
</view>
<!-- 热门服务 -->
<Card>
<template #header>
<view class="section-header">
<text class="section-icon">🔥</text>
<text class="card-title">热门服务</text>
</view>
</template>
<GridLayout :columns="4" gap="12px">
<ServiceItem
v-for="service in hotServices"
:key="service.title"
:title="service.title"
:icon="service.icon"
:badge="service.badge"
@click="handleServiceClick"
/>
</GridLayout>
</Card>
<!-- 学习教务 -->
<Card>
<template #header>
<view class="section-header">
<text class="section-icon">🎓</text>
<text class="card-title">学习教务</text>
</view>
</template>
<GridLayout :columns="3" gap="12px">
<ServiceItem
v-for="service in academicServices"
:key="service.title"
:title="service.title"
:icon="service.icon"
@click="handleServiceClick"
/>
</GridLayout>
</Card>
<!-- 生活服务 -->
<Card>
<template #header>
<view class="section-header">
<text class="section-icon">🏠</text>
<text class="card-title">生活服务</text>
</view>
</template>
<GridLayout :columns="3" gap="12px">
<ServiceItem
v-for="service in lifeServices"
:key="service.title"
:title="service.title"
:icon="service.icon"
@click="handleServiceClick"
/>
</GridLayout>
</Card>
<!-- 校园资源 -->
<Card>
<template #header>
<view class="section-header">
<text class="section-icon">🏢</text>
<text class="card-title">校园资源</text>
</view>
</template>
<GridLayout :columns="3" gap="12px">
<ServiceItem
v-for="service in resourceServices"
:key="service.title"
:title="service.title"
:icon="service.icon"
@click="handleServiceClick"
/>
</GridLayout>
</Card>
<!-- 办事服务 -->
<Card>
<template #header>
<view class="section-header">
<text class="section-icon">📋</text>
<text class="card-title">办事服务</text>
</view>
</template>
<GridLayout :columns="3" gap="12px">
<ServiceItem
v-for="service in adminServices"
:key="service.title"
:title="service.title"
:icon="service.icon"
@click="handleServiceClick"
/>
</GridLayout>
</Card>
<!-- 信息查询 -->
<Card>
<template #header>
<view class="section-header">
<text class="section-icon">🔍</text>
<text class="card-title">信息查询</text>
</view>
</template>
<GridLayout :columns="3" gap="12px">
<ServiceItem
v-for="service in queryServices"
:key="service.title"
:title="service.title"
:icon="service.icon"
@click="handleServiceClick"
/>
</GridLayout>
</Card>
<!-- 快捷工具 -->
<Card>
<template #header>
<view class="section-header">
<text class="section-icon">⚡</text>
<text class="card-title">快捷工具</text>
</view>
</template>
<GridLayout :columns="3" gap="12px">
<ServiceItem
v-for="service in toolServices"
:key="service.title"
:title="service.title"
:icon="service.icon"
@click="handleServiceClick"
/>
</GridLayout>
</Card>
<!-- 底部间距 -->
<view class="bottom-spacer"></view>
</scroll-view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue';
import Card from '@/components/Card.vue';
import ServiceItem from '@/components/ServiceItem.vue';
import GridLayout from '@/components/GridLayout.vue';
export default {
name: 'WorkbenchPage',
components: {
NavBar,
Card,
ServiceItem,
GridLayout,
},
data() {
return {
searchQuery: '',
searchFocused: false,
hotServices: [
{ title: '课程表', icon: '🎓' },
{ title: '成绩查询', icon: '📊' },
{ title: '校园卡', icon: '💳' },
{ title: '图书馆', icon: '📚' },
],
academicServices: [
{ title: '我的课表', icon: '🎓' },
{ title: '成绩查询', icon: '📊' },
{ title: '选课系统', icon: '👨‍🎓' },
{ title: '考试安排', icon: '📝' },
{ title: '课程评教', icon: '📋' },
{ title: '学分查询', icon: '🏆' },
{ title: '作业提交', icon: '📄' },
{ title: '竞赛报名', icon: '🏅' },
{ title: '教学评价', icon: '👨‍🏫' },
],
lifeServices: [
{ title: '食堂菜单', icon: '🍽️' },
{ title: '校园卡', icon: '💳' },
{ title: '宿舍管理', icon: '🛏️' },
{ title: '停车服务', icon: '🚗' },
{ title: '校车时刻', icon: '🚌' },
{ title: '校园购物', icon: '🛒' },
{ title: '医疗服务', icon: '🏥' },
{ title: '报修服务', icon: '🔧' },
{ title: '空调控制', icon: '🌡️' },
],
resourceServices: [
{ title: '图书馆', icon: '📚' },
{ title: '机房预约', icon: '💻' },
{ title: '会议室', icon: '🎤' },
{ title: '体育馆', icon: '🏃‍♂️' },
{ title: '艺术中心', icon: '🎭' },
{ title: '实验室', icon: '🧪' },
{ title: '打印服务', icon: '🖨️' },
{ title: '网络服务', icon: '📶' },
{ title: '设备租借', icon: '🔧' },
],
adminServices: [
{ title: '学费缴费', icon: '💰' },
{ title: '证明开具', icon: '📄' },
{ title: '学生证', icon: '🆔' },
{ title: '学籍管理', icon: '👤' },
{ title: '转专业', icon: '🔄' },
{ title: '请假申请', icon: '✈️' },
{ title: '毕业申请', icon: '🎓' },
{ title: '就业指导', icon: '💼' },
{ title: '国际交流', icon: '🌍' },
],
queryServices: [
{ title: '校历查询', icon: '📅' },
{ title: '校园通讯录', icon: '📞' },
{ title: '校园地图', icon: '🗺️' },
{ title: '通知公告', icon: '📢' },
{ title: '常见问题', icon: '❓' },
{ title: '意见反馈', icon: '💬' },
{ title: '在线客服', icon: '🎧' },
{ title: '数据统计', icon: '📈' },
{ title: '校园新闻', icon: '📰' },
],
toolServices: [
{ title: '扫一扫', icon: '📱' },
{ title: '计算器', icon: '🧮' },
{ title: '作息时间', icon: '⏰' },
{ title: '天气查询', icon: '☁️' },
{ title: '翻译工具', icon: '🔤' },
{ title: '分享', icon: '📤' },
],
};
},
methods: {
handleSearch() {
this.focusSearch();
},
focusSearch() {
this.searchFocused = true;
},
handleSearchInput(e) {
this.searchQuery = e.detail.value;
// 实现搜索建议逻辑
this.showSearchSuggestions();
},
handleSearchConfirm() {
if (this.searchQuery.trim()) {
this.performSearch(this.searchQuery);
}
},
showSearchSuggestions() {
// 根据输入显示搜索建议
if (this.searchQuery.length > 0) {
// 这里可以实现搜索建议逻辑
}
},
performSearch(query) {
uni.showToast({
title: `搜索: ${query}`,
icon: 'none',
duration: 2000,
});
this.searchFocused = false;
},
handleServiceClick(service) {
uni.vibrateShort();
// 根据不同服务类型进行路由跳转或功能调用
switch (service.title) {
case '课程表':
case '我的课表':
this.openCourseSchedule();
break;
case '成绩查询':
this.openGradeQuery();
break;
case '校园卡':
this.openCampusCard();
break;
case '图书馆':
this.openLibrary();
break;
case '扫一扫':
this.openScanner();
break;
default:
uni.showToast({
title: `${service.title}功能开发中`,
icon: 'none',
});
}
},
openCourseSchedule() {
uni.showToast({ title: '打开课程表', icon: 'success' });
// 这里可以跳转到课程表页面
},
openGradeQuery() {
uni.showToast({ title: '打开成绩查询', icon: 'success' });
// 这里可以跳转到成绩查询页面
},
openCampusCard() {
uni.showToast({ title: '打开校园卡', icon: 'success' });
// 这里可以跳转到校园卡页面
},
openLibrary() {
uni.showToast({ title: '打开图书馆', icon: 'success' });
// 这里可以跳转到图书馆页面
},
openScanner() {
uni.scanCode({
success: (res) => {
uni.showToast({
title: `扫描结果: ${res.result}`,
icon: 'none',
});
},
fail: () => {
uni.showToast({
title: '扫描失败',
icon: 'error',
});
},
});
},
},
onLoad() {},
};
</script>
<style lang="scss" scoped>
.page-container {
min-height: 100vh;
background-color: $uni-bg-color-grey;
display: flex;
flex-direction: column;
}
.main-content {
flex: 1;
padding-bottom: calc(50px + env(safe-area-inset-bottom));
}
/* 搜索栏 */
.search-section {
padding: $uni-spacing-col-lg;
}
.search-bar {
position: relative;
background: $uni-bg-color;
border-radius: $uni-border-radius-lg;
box-shadow: $uni-shadow;
display: flex;
align-items: center;
padding: 0 $uni-spacing-row-lg;
transition: $uni-transition;
&:hover {
box-shadow: $uni-shadow-hover;
}
}
.search-icon {
font-size: 16px;
color: $uni-text-color-grey;
margin-right: $uni-spacing-row-base;
}
.search-input {
flex: 1;
padding: $uni-spacing-col-base 0;
font-size: $uni-font-size-lg;
border: none;
outline: none;
background: transparent;
color: $uni-text-color;
&::placeholder {
color: $uni-text-color-placeholder;
}
}
/* 分组标题 */
.section-header {
display: flex;
align-items: center;
gap: 8px;
}
.section-icon {
font-size: $uni-font-size-lg;
}
/* 服务网格动画 */
.service-item {
animation-delay: calc(var(--item-index, 0) * 0.1s);
animation: slideInUp 0.6s ease-out backwards;
}
@keyframes slideInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 搜索焦点效果 */
.search-bar:focus-within {
transform: translateY(-2px);
box-shadow: $uni-shadow-hover;
.search-icon {
color: $uni-color-primary;
}
}
/* 底部间距 */
.bottom-spacer {
height: 20px;
}
/* 页面进入动画 */
.page-container {
animation: fadeInUp 0.6s ease-out;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 响应式设计 */
@media (max-width: 375px) {
.search-section {
padding: $uni-spacing-col-base;
}
.search-bar {
padding: 0 $uni-spacing-row-base;
}
.search-input {
font-size: $uni-font-size-base;
}
}
</style>
-494
View File
@@ -1,494 +0,0 @@
<template>
<view class="workbench-container">
<!-- 自定义导航栏 -->
<u-navbar
title="工作台"
:is-back="false"
:border-bottom="false"
:custom-style="{ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)' }"
title-color="#fff"
>
<template #right>
<u-icon name="search" color="#fff" size="44" @click="showSearch"></u-icon>
</template>
</u-navbar>
<!-- 主体内容 -->
<view class="content">
<!-- 工作统计 -->
<view class="work-stats card">
<view class="section-title">
<text>工作统计</text>
<text class="date">{{ today }}</text>
</view>
<view class="stats-row">
<view
v-for="(item, index) in workStats"
:key="index"
class="stat-item"
@click="onStatClick(item)"
>
<view class="stat-icon" :style="{ background: item.color }">
<u-icon :name="item.icon" color="#fff" size="36"></u-icon>
</view>
<view class="stat-info">
<text class="stat-value">{{ item.value }}</text>
<text class="stat-label">{{ item.label }}</text>
</view>
</view>
</view>
</view>
<!-- 待办事项 -->
<view class="todo-section card">
<view class="section-title">
<text>待办事项</text>
<view class="badge" v-if="todoList.length > 0">{{ todoList.length }}</view>
</view>
<view class="todo-list" v-if="todoList.length > 0">
<view
v-for="(item, index) in todoList"
:key="index"
class="todo-item"
@click="onTodoClick(item)"
>
<view class="todo-left">
<view class="priority-dot" :class="item.priority"></view>
<view class="todo-content">
<text class="todo-title">{{ item.title }}</text>
<text class="todo-time">{{ item.deadline }}</text>
</view>
</view>
<view class="todo-status" :class="item.status">
{{ getStatusText(item.status) }}
</view>
</view>
</view>
<view v-else class="empty-state">
<u-icon name="checkbox-mark" color="#c8c9cc" size="80"></u-icon>
<text>暂无待办事项</text>
</view>
</view>
<!-- 工作流程 -->
<view class="workflow-section card">
<view class="section-title">
<text>工作流程</text>
</view>
<view class="workflow-grid">
<view
v-for="(item, index) in workflowItems"
:key="index"
class="workflow-item"
@click="onWorkflowClick(item)"
>
<view class="workflow-icon" :style="{ background: item.color }">
<u-icon :name="item.icon" color="#fff" size="40"></u-icon>
</view>
<text class="workflow-text">{{ item.name }}</text>
<view class="workflow-badge" v-if="item.badge">{{ item.badge }}</view>
</view>
</view>
</view>
<!-- 快速操作 -->
<view class="quick-ops card">
<view class="section-title">
<text>快速操作</text>
</view>
<view class="ops-list">
<view
v-for="(item, index) in quickOps"
:key="index"
class="ops-item"
@click="onQuickOpClick(item)"
>
<view class="ops-left">
<u-icon :name="item.icon" :color="item.color" size="40"></u-icon>
<view class="ops-info">
<text class="ops-title">{{ item.title }}</text>
<text class="ops-desc">{{ item.desc }}</text>
</view>
</view>
<u-icon name="arrow-right" color="#c8c9cc" size="28"></u-icon>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'Workbench',
data() {
return {
today: '',
workStats: [
{ label: '今日任务', value: '8', icon: 'list', color: '#3c9cff' },
{ label: '已完成', value: '5', icon: 'checkmark', color: '#5ac725' },
{ label: '进行中', value: '2', icon: 'clock', color: '#f9ae3d' },
{ label: '待审批', value: '1', icon: 'eye', color: '#f56c6c' },
],
todoList: [
{
title: '审核学生请假申请',
deadline: '今天 18:00',
priority: 'high',
status: 'pending',
},
{
title: '提交月度工作报告',
deadline: '明天 12:00',
priority: 'medium',
status: 'in-progress',
},
{
title: '参加部门例会',
deadline: '2024-02-16 14:00',
priority: 'low',
status: 'pending',
},
],
workflowItems: [
{ name: '请假审批', icon: 'file-text', color: '#ff6b6b', badge: '3' },
{ name: '报销审批', icon: 'rmb-circle', color: '#4ecdc4', badge: '1' },
{ name: '采购审批', icon: 'shopping-cart', color: '#45b7d1' },
{ name: '合同审批', icon: 'file', color: '#f9ca24' },
],
quickOps: [
{
title: '创建任务',
desc: '快速创建新的工作任务',
icon: 'plus-circle',
color: '#3c9cff',
},
{
title: '工作日志',
desc: '记录今日工作内容',
icon: 'edit-pen',
color: '#5ac725',
},
{
title: '团队协作',
desc: '查看团队成员工作状态',
icon: 'account',
color: '#f9ae3d',
},
{
title: '数据统计',
desc: '查看工作效率统计',
icon: 'bar-chart',
color: '#f56c6c',
},
],
};
},
onLoad() {
this.initPage();
},
methods: {
// 初始化页面
initPage() {
this.setToday();
},
// 设置当前日期
setToday() {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
this.today = `${year}-${month}-${day}`;
},
// 获取状态文本
getStatusText(status) {
const statusMap = {
pending: '待处理',
'in-progress': '进行中',
completed: '已完成',
};
return statusMap[status] || '未知';
},
// 统计项点击
onStatClick(item) {
console.log('点击统计', item.label);
this.$u.toast(`查看${item.label}`);
},
// 待办事项点击
onTodoClick(item) {
console.log('点击待办', item.title);
this.$u.toast(`处理:${item.title}`);
},
// 工作流程点击
onWorkflowClick(item) {
console.log('点击工作流', item.name);
this.$u.toast(`打开${item.name}`);
},
// 快速操作点击
onQuickOpClick(item) {
console.log('点击快速操作', item.title);
this.$u.toast(item.title);
},
// 显示搜索
showSearch() {
this.$u.toast('搜索功能');
},
},
};
</script>
<style lang="scss" scoped>
.workbench-container {
background: #f5f5f5;
min-height: 100vh;
}
.content {
padding: 20rpx;
}
.section-title {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
text {
font-size: 32rpx;
font-weight: bold;
color: #303133;
}
.date {
font-size: 24rpx;
color: #909399;
}
.badge {
background: #f56c6c;
color: #fff;
font-size: 20rpx;
padding: 8rpx 16rpx;
border-radius: 20rpx;
min-width: 32rpx;
text-align: center;
}
}
.work-stats {
.stats-row {
display: flex;
gap: 20rpx;
.stat-item {
flex: 1;
display: flex;
align-items: center;
gap: 20rpx;
padding: 20rpx;
background: #fafafa;
border-radius: 12rpx;
.stat-icon {
width: 60rpx;
height: 60rpx;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
}
.stat-info {
.stat-value {
display: block;
font-size: 32rpx;
font-weight: bold;
color: #303133;
margin-bottom: 4rpx;
}
.stat-label {
font-size: 20rpx;
color: #909399;
}
}
}
}
}
.todo-section {
.todo-list {
.todo-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 2rpx solid #f5f5f5;
&:last-child {
border-bottom: none;
}
.todo-left {
display: flex;
align-items: center;
gap: 20rpx;
flex: 1;
.priority-dot {
width: 12rpx;
height: 12rpx;
border-radius: 50%;
&.high {
background: #f56c6c;
}
&.medium {
background: #f9ae3d;
}
&.low {
background: #5ac725;
}
}
.todo-content {
.todo-title {
display: block;
font-size: 28rpx;
color: #303133;
margin-bottom: 8rpx;
}
.todo-time {
font-size: 24rpx;
color: #909399;
}
}
}
.todo-status {
font-size: 24rpx;
padding: 8rpx 16rpx;
border-radius: 8rpx;
&.pending {
background: #fef0f0;
color: #f56c6c;
}
&.in-progress {
background: #fdf6ec;
color: #f9ae3d;
}
&.completed {
background: #f0f9ff;
color: #5ac725;
}
}
}
}
.empty-state {
text-align: center;
padding: 80rpx 0;
color: #c8c9cc;
text {
display: block;
margin-top: 20rpx;
font-size: 28rpx;
}
}
}
.workflow-section {
.workflow-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 30rpx;
.workflow-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 16rpx;
position: relative;
.workflow-icon {
width: 80rpx;
height: 80rpx;
border-radius: 20rpx;
display: flex;
align-items: center;
justify-content: center;
}
.workflow-text {
font-size: 24rpx;
color: #303133;
text-align: center;
}
.workflow-badge {
position: absolute;
top: -10rpx;
right: 10rpx;
background: #f56c6c;
color: #fff;
font-size: 20rpx;
padding: 4rpx 8rpx;
border-radius: 10rpx;
min-width: 20rpx;
text-align: center;
}
}
}
}
.quick-ops {
.ops-list {
.ops-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx 0;
border-bottom: 2rpx solid #f5f5f5;
&:last-child {
border-bottom: none;
}
.ops-left {
display: flex;
align-items: center;
gap: 20rpx;
flex: 1;
.ops-info {
.ops-title {
display: block;
font-size: 28rpx;
color: #303133;
margin-bottom: 8rpx;
}
.ops-desc {
font-size: 24rpx;
color: #909399;
}
}
}
}
}
}
</style>