From 384373a2c1962f10e685c5e84d509619f3db6874 Mon Sep 17 00:00:00 2001
From: zlwu <704541015@qq.com>
Date: Sat, 25 Oct 2025 17:19:54 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
mobile/src/App.vue | 26 +
mobile/src/pages.json | 8 +-
mobile/src/pages/internship/index.vue | 424 ++++++------
mobile/src/pages/visit/add.vue | 646 +++++++++---------
mobile/src/pages/visit/detail.vue | 428 ++++++------
mobile/src/pages/visit/edit.vue | 527 +++++++-------
mobile/src/pages/visit/index.vue | 424 +++++++-----
.../src/pages/workStudy/applicationDetail.vue | 213 +++---
mobile/src/pages/workStudy/apply.vue | 445 ++++++------
mobile/src/pages/workStudy/detail.vue | 262 +++----
mobile/src/pages/workStudy/index.vue | 460 +++++++------
11 files changed, 2053 insertions(+), 1810 deletions(-)
diff --git a/mobile/src/App.vue b/mobile/src/App.vue
index e793dbc5..c7cf51d8 100644
--- a/mobile/src/App.vue
+++ b/mobile/src/App.vue
@@ -159,6 +159,32 @@ page {
background: #0051d9 !important;
}
+/* Navbar导航栏主题色覆盖 - 勤工俭学模块统一背景色 */
+.u-navbar {
+ background-color: #0051d9 !important;
+}
+
+.u-navbar__content {
+ background-color: #0051d9 !important;
+}
+
+.u-navbar__content__title {
+ color: #fff !important;
+}
+
+/* uni-app 原生导航栏样式覆盖 */
+uni-page-head {
+ background-color: #0051d9 !important;
+}
+
+.uni-page-head {
+ background-color: #0051d9 !important;
+}
+
+.uni-page-head__title {
+ color: #fff !important;
+}
+
/* ========== 全局温暖商务风格样式 ========== */
/* 全局页面背景 */
diff --git a/mobile/src/pages.json b/mobile/src/pages.json
index 1c061b33..65697572 100644
--- a/mobile/src/pages.json
+++ b/mobile/src/pages.json
@@ -274,7 +274,7 @@
"path": "pages/workStudy/index",
"style": {
"navigationBarTitleText": "勤工俭学",
- "navigationBarBackgroundColor": "#1890ff",
+ "navigationBarBackgroundColor": "#0051d9",
"navigationBarTextStyle": "white"
}
},
@@ -282,7 +282,7 @@
"path": "pages/workStudy/detail",
"style": {
"navigationBarTitleText": "岗位详情",
- "navigationBarBackgroundColor": "#1890ff",
+ "navigationBarBackgroundColor": "#0051d9",
"navigationBarTextStyle": "white"
}
},
@@ -290,7 +290,7 @@
"path": "pages/workStudy/apply",
"style": {
"navigationBarTitleText": "申请岗位",
- "navigationBarBackgroundColor": "#1890ff",
+ "navigationBarBackgroundColor": "#0051d9",
"navigationBarTextStyle": "white"
}
},
@@ -298,7 +298,7 @@
"path": "pages/workStudy/applicationDetail",
"style": {
"navigationBarTitleText": "申请详情",
- "navigationBarBackgroundColor": "#1890ff",
+ "navigationBarBackgroundColor": "#0051d9",
"navigationBarTextStyle": "white"
}
},
diff --git a/mobile/src/pages/internship/index.vue b/mobile/src/pages/internship/index.vue
index 2d82eee0..d28c3aff 100644
--- a/mobile/src/pages/internship/index.vue
+++ b/mobile/src/pages/internship/index.vue
@@ -1,5 +1,12 @@
+
+
+
+
+
+
+
@@ -23,8 +30,10 @@
@@ -59,9 +68,11 @@
-
@@ -243,13 +255,13 @@ export default {
return {
// 页面参数
visitId: '',
-
+
// 页面状态
pageLoading: true,
-
+
// 走访信息
visitInfo: {},
-
+
// 表单数据
form: {
visitId: '',
@@ -268,37 +280,37 @@ export default {
visitSummary: '',
visitImages: '',
remark: '',
- status: ''
+ status: '',
},
-
+
// 表单验证规则
rules: {
visitDate: [
- { required: true, message: '请选择走访日期', trigger: ['blur', 'change'] }
+ { required: true, message: '请选择走访日期', trigger: ['blur', 'change'] },
],
visitorName: [
- { required: true, message: '请输入走访人员姓名', trigger: ['blur', 'change'] }
+ { required: true, message: '请输入走访人员姓名', trigger: ['blur', 'change'] },
],
visitPurpose: [
- { required: true, message: '请输入走访目的', trigger: ['blur', 'change'] }
- ]
+ { required: true, message: '请输入走访目的', trigger: ['blur', 'change'] },
+ ],
},
-
+
// 日期选择
showVisitDatePicker: false,
visitDateValue: Date.now(),
maxDate: Date.now() + 30 * 24 * 60 * 60 * 1000, // 30天后
-
+
// 图片上传
imageList: [],
maxImageCount: 10,
-
+
// 加载状态
submitLoading: false,
- draftLoading: false
+ draftLoading: false,
};
},
-
+
onLoad(options) {
if (options.id) {
this.visitId = options.id;
@@ -308,17 +320,22 @@ export default {
uni.navigateBack();
}
},
-
+
methods: {
+ // 返回上一页
+ goBack() {
+ uni.navigateBack();
+ },
+
// 加载走访记录详情
async loadVisitDetail() {
this.pageLoading = true;
try {
const response = await getVisit(this.visitId);
-
+
if (response.code === 200 && response.data) {
this.visitInfo = response.data;
-
+
// 填充表单数据
this.form = {
visitId: response.data.visitId,
@@ -337,9 +354,9 @@ export default {
visitSummary: response.data.visitSummary,
visitImages: response.data.visitImages,
remark: response.data.remark,
- status: response.data.status
+ status: response.data.status,
};
-
+
// 处理图片数据
if (response.data.visitImages) {
try {
@@ -349,12 +366,11 @@ export default {
this.imageList = [];
}
}
-
+
// 设置日期选择器的值
if (response.data.visitDate) {
this.visitDateValue = new Date(response.data.visitDate).getTime();
}
-
} else {
uni.showToast({ title: response.msg || '获取数据失败', icon: 'none' });
uni.navigateBack();
@@ -367,14 +383,14 @@ export default {
this.pageLoading = false;
}
},
-
+
// 走访日期确认
handleVisitDateConfirm(value) {
const date = new Date(value);
this.form.visitDate = this.formatDate(date);
this.showVisitDatePicker = false;
},
-
+
// 格式化日期
formatDate(date) {
const year = date.getFullYear();
@@ -382,7 +398,7 @@ export default {
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
-
+
// 选择图片
chooseImage() {
const remainCount = this.maxImageCount - this.imageList.length;
@@ -392,24 +408,24 @@ export default {
sourceType: ['album', 'camera'],
success: (res) => {
this.handleImageUpload(res.tempFilePaths);
- }
+ },
});
},
-
+
// 处理图片上传
async handleImageUpload(filePaths) {
uni.showLoading({ title: '上传中...' });
-
+
try {
for (const filePath of filePaths) {
// 这里应该调用具体的文件上传接口
// 暂时使用本地路径作为示例
this.imageList.push({
url: filePath,
- path: filePath
+ path: filePath,
});
}
-
+
// 更新表单中的图片数据
this.form.visitImages = JSON.stringify(this.imageList);
} catch (error) {
@@ -419,33 +435,33 @@ export default {
uni.hideLoading();
}
},
-
+
// 预览图片
previewImage(index) {
- const urls = this.imageList.map(item => item.url);
+ const urls = this.imageList.map((item) => item.url);
uni.previewImage({
urls,
- current: index
+ current: index,
});
},
-
+
// 删除图片
removeImage(index) {
this.imageList.splice(index, 1);
this.form.visitImages = JSON.stringify(this.imageList);
},
-
+
// 保存草稿
async saveDraft() {
this.draftLoading = true;
try {
const formData = {
...this.form,
- status: 'planned' // 草稿状态
+ status: 'planned', // 草稿状态
};
-
+
const response = await updateVisit(formData);
-
+
if (response.code === 200) {
uni.showToast({ title: '草稿保存成功', icon: 'success' });
setTimeout(() => {
@@ -461,7 +477,7 @@ export default {
this.draftLoading = false;
}
},
-
+
// 提交表单
async submitForm() {
// 表单验证
@@ -471,16 +487,16 @@ export default {
console.log('表单验证失败:', error);
return;
}
-
+
this.submitLoading = true;
try {
const formData = {
...this.form,
- status: 'completed' // 已完成状态
+ status: 'completed', // 已完成状态
};
-
+
const response = await updateVisit(formData);
-
+
if (response.code === 200) {
uni.showToast({ title: '更新成功', icon: 'success' });
setTimeout(() => {
@@ -495,8 +511,8 @@ export default {
} finally {
this.submitLoading = false;
}
- }
- }
+ },
+ },
};
@@ -504,6 +520,9 @@ export default {
.visit-edit-container {
min-height: 100vh;
background-color: #f8f8f8;
+}
+
+.content-wrapper {
padding-bottom: 120rpx; // 为底部按钮留出空间
}
@@ -511,7 +530,13 @@ export default {
background: #ffffff;
margin-bottom: 20rpx;
padding: 0 20rpx;
-
+ border-radius: 12rpx;
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
+
+ &:first-child {
+ margin-top: 20rpx;
+ }
+
.section-title {
padding: 24rpx 0 16rpx;
font-size: 32rpx;
@@ -527,21 +552,21 @@ export default {
border-radius: 8rpx;
padding: 20rpx;
margin-top: 16rpx;
-
+
.info-row {
display: flex;
margin-bottom: 12rpx;
-
+
&:last-child {
margin-bottom: 0;
}
-
+
.info-label {
font-size: 28rpx;
color: #606266;
width: 140rpx;
}
-
+
.info-value {
font-size: 28rpx;
color: #303133;
@@ -556,19 +581,19 @@ export default {
flex-wrap: wrap;
gap: 16rpx;
margin-bottom: 16rpx;
-
+
.image-item {
position: relative;
width: 160rpx;
height: 160rpx;
border-radius: 8rpx;
overflow: hidden;
-
+
image {
width: 100%;
height: 100%;
}
-
+
.delete-btn {
position: absolute;
top: 8rpx;
@@ -582,7 +607,7 @@ export default {
justify-content: center;
}
}
-
+
.upload-btn {
width: 160rpx;
height: 160rpx;
@@ -592,7 +617,7 @@ export default {
flex-direction: column;
align-items: center;
justify-content: center;
-
+
.upload-text {
font-size: 24rpx;
color: #c8c9cc;
@@ -600,7 +625,7 @@ export default {
}
}
}
-
+
.upload-tip {
font-size: 24rpx;
color: #909399;
@@ -619,4 +644,4 @@ export default {
align-items: center;
z-index: 100;
}
-
\ No newline at end of file
+
diff --git a/mobile/src/pages/visit/index.vue b/mobile/src/pages/visit/index.vue
index ab96553e..8dde96f0 100644
--- a/mobile/src/pages/visit/index.vue
+++ b/mobile/src/pages/visit/index.vue
@@ -1,15 +1,21 @@
+
+
+
+
+
+
+
-
@@ -47,19 +53,21 @@
-
筛选
-
重置
@@ -68,30 +76,36 @@
-
{{ showFilter ? '收起筛选' : '展开筛选' }}
-
+
新增走访
+
+
+
-
-
-
+
+
+
+
+
+
@@ -102,83 +116,99 @@
{{ item.studentNo }}
-
-
+
{{ item.companyName || '-' }}
-
+
{{ item.visitDate || '-' }}
-
+
{{ item.visitorName || '-' }}
-
+
- {{ item.className || '-' }} / {{ item.majorName || '-' }}
+
+ {{ item.className || '-' }} / {{ item.majorName || '-' }}
+
-
+
-
+
编辑
-
+
删除
+
+
+ 查看
+
-
-
-
-
+
+
-
-
-
-
- 加载中...
-
-
-
-
-
-
@@ -218,51 +248,56 @@ export default {
visitorName: '',
status: '',
beginVisitDate: '',
- endVisitDate: ''
+ endVisitDate: '',
},
-
+
// 列表数据
visitList: [],
total: 0,
loading: false,
hasMore: true,
loadMoreStatus: 'loadmore',
-
+
// 状态选择
showStatusPicker: false,
statusOptions: [],
currentStatusIndex: -1,
statusText: '',
statusDict: [],
-
+
// 日期选择
showDatePicker: false,
dateRangeText: '',
- selectedDateRange: []
+ selectedDateRange: [],
};
},
-
+
onLoad() {
this.initPage();
},
-
+
onPullDownRefresh() {
this.refreshList();
},
-
+
onReachBottom() {
if (this.hasMore && this.loadMoreStatus === 'loadmore') {
this.loadMore();
}
},
-
+
methods: {
+ // 返回上一页
+ goBack() {
+ uni.navigateBack();
+ },
+
// 初始化页面
async initPage() {
await this.loadStatusDict();
this.getList();
},
-
+
// 加载状态字典
async loadStatusDict() {
try {
@@ -272,55 +307,57 @@ export default {
this.statusOptions = [
[
{ text: '全部状态', value: '' },
- ...response.data.map(item => ({
+ ...response.data.map((item) => ({
text: item.dictLabel,
- value: item.dictValue
- }))
- ]
+ value: item.dictValue,
+ })),
+ ],
];
}
} catch (error) {
console.error('加载状态字典失败:', error);
// 设置默认状态选项
- this.statusOptions = [[
- { text: '全部状态', value: '' },
- { text: '计划中', value: 'planned' },
- { text: '已完成', value: 'completed' },
- { text: '已取消', value: 'cancelled' }
- ]];
+ this.statusOptions = [
+ [
+ { text: '全部状态', value: '' },
+ { text: '计划中', value: 'planned' },
+ { text: '已完成', value: 'completed' },
+ { text: '已取消', value: 'cancelled' },
+ ],
+ ];
}
},
-
+
// 获取列表数据
async getList(isLoadMore = false) {
if (this.loading) return;
-
+
this.loading = true;
if (!isLoadMore) {
this.loadMoreStatus = 'loadmore';
} else {
this.loadMoreStatus = 'loading';
}
-
+
try {
const response = await listVisit(this.queryParams);
-
+
if (response.code === 200) {
// 后端返回的是TableDataInfo格式,直接包含rows和total字段
const { rows, total } = response;
-
+
if (isLoadMore) {
- this.visitList = [...this.visitList, ...rows || []];
+ this.visitList = [...this.visitList, ...(rows || [])];
} else {
this.visitList = rows || [];
}
-
+
this.total = total || 0;
-
+
// 判断是否还有更多数据
const currentTotal = this.visitList.length;
this.hasMore = currentTotal < this.total;
-
+
if (!this.hasMore) {
this.loadMoreStatus = 'nomore';
}
@@ -337,13 +374,13 @@ export default {
}
}
},
-
+
// 刷新列表
refreshList() {
this.queryParams.pageNum = 1;
this.getList();
},
-
+
// 加载更多
loadMore() {
if (this.hasMore && !this.loading) {
@@ -351,18 +388,18 @@ export default {
this.getList(true);
}
},
-
+
// 搜索
handleSearch() {
this.queryParams.studentKeyword = this.searchKeyword;
this.refreshList();
},
-
+
// 筛选
handleFilter() {
this.refreshList();
},
-
+
// 重置筛选
resetFilter() {
this.queryParams = {
@@ -372,7 +409,7 @@ export default {
visitorName: '',
status: '',
beginVisitDate: '',
- endVisitDate: ''
+ endVisitDate: '',
};
this.statusText = '';
this.dateRangeText = '';
@@ -380,7 +417,7 @@ export default {
this.currentStatusIndex = -1;
this.refreshList();
},
-
+
// 状态选择确认
handleStatusConfirm(value) {
const selected = value.value[0];
@@ -389,7 +426,7 @@ export default {
this.currentStatusIndex = value.index[0];
this.showStatusPicker = false;
},
-
+
// 日期选择确认
handleDateConfirm(value) {
this.selectedDateRange = value;
@@ -404,7 +441,33 @@ export default {
}
this.showDatePicker = false;
},
-
+
+ // 获取状态标签文本
+ getStatusLabel(status) {
+ // 如果statusDict字典已加载,从字典中查找
+ if (this.statusDict && this.statusDict.length > 0) {
+ const dictItem = this.statusDict.find((item) => item.dictValue === String(status));
+ if (dictItem) {
+ return dictItem.dictLabel;
+ }
+ }
+
+ // 如果字典未加载或找不到,使用默认映射
+ switch (String(status)) {
+ case 'planned':
+ case '0':
+ return '计划中';
+ case 'completed':
+ case '1':
+ return '已完成';
+ case 'cancelled':
+ case '2':
+ return '已取消';
+ default:
+ return status || '未知';
+ }
+ },
+
// 获取状态类型
getStatusType(status) {
switch (status) {
@@ -421,28 +484,28 @@ export default {
return 'default';
}
},
-
+
// 查看详情
handleView(item) {
uni.navigateTo({
- url: `/pages/visit/detail?id=${item.visitId}`
+ url: `/pages/visit/detail?id=${item.visitId}`,
});
},
-
+
// 新增走访
handleAdd() {
uni.navigateTo({
- url: '/pages/visit/add'
+ url: '/pages/visit/add',
});
},
-
+
// 编辑走访
handleEdit(item) {
uni.navigateTo({
- url: `/pages/visit/edit?id=${item.visitId}`
+ url: `/pages/visit/edit?id=${item.visitId}`,
});
},
-
+
// 删除走访
handleDelete(item) {
uni.showModal({
@@ -452,16 +515,16 @@ export default {
if (res.confirm) {
await this.deleteVisit(item.visitId);
}
- }
+ },
});
},
-
+
// 执行删除
async deleteVisit(id) {
try {
uni.showLoading({ title: '删除中...' });
const response = await delVisit(id);
-
+
if (response.code === 200) {
uni.showToast({ title: '删除成功', icon: 'success' });
this.refreshList();
@@ -474,8 +537,8 @@ export default {
} finally {
uni.hideLoading();
}
- }
- }
+ },
+ },
};
@@ -494,11 +557,11 @@ export default {
background: #ffffff;
padding: 0 20rpx 20rpx;
border-bottom: 1rpx solid #ebeef5;
-
+
.filter-item {
margin-bottom: 20rpx;
}
-
+
.filter-actions {
display: flex;
justify-content: flex-end;
@@ -515,76 +578,83 @@ export default {
border-bottom: 1rpx solid #ebeef5;
}
-.list-container {
+.content-wrapper {
padding: 20rpx;
}
-.visit-card {
- background: #ffffff;
- border-radius: 12rpx;
- padding: 24rpx;
- margin-bottom: 20rpx;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
-
- .card-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 16rpx;
-
- .student-info {
- .student-name {
- font-size: 32rpx;
- font-weight: 600;
- color: #303133;
- margin-right: 16rpx;
- }
-
- .student-no {
- font-size: 26rpx;
- color: #909399;
- }
- }
- }
-
- .card-row {
- display: flex;
- align-items: center;
- margin-bottom: 12rpx;
-
- .info-text {
- font-size: 28rpx;
- color: #606266;
- margin-left: 8rpx;
- }
-
- &:last-of-type {
- margin-bottom: 16rpx;
- }
- }
-
- .card-actions {
- display: flex;
- justify-content: flex-end;
- gap: 10rpx;
- padding-top: 16rpx;
- border-top: 1rpx solid #ebeef5;
- }
-}
-
-.empty-state {
+.empty-container {
padding: 80rpx 20rpx;
text-align: center;
}
-.loading-state {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 40rpx;
+.list-content {
+ .visit-card {
+ background: #ffffff;
+ border-radius: 12rpx;
+ padding: 24rpx;
+ margin-bottom: 20rpx;
+ box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
+ transition: all 0.3s ease;
+
+ &:active {
+ transform: scale(0.99);
+ box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06);
+ }
+
+ .card-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: 16rpx;
+
+ .student-info {
+ flex: 1;
+
+ .student-name {
+ font-size: 32rpx;
+ font-weight: 600;
+ color: #303133;
+ margin-right: 16rpx;
+ }
+
+ .student-no {
+ font-size: 26rpx;
+ color: #909399;
+ }
+ }
+
+ .status-badge {
+ flex-shrink: 0;
+ }
+ }
+
+ .card-row {
+ display: flex;
+ align-items: center;
+ margin-bottom: 12rpx;
+
+ .info-text {
+ font-size: 28rpx;
+ color: #606266;
+ margin-left: 8rpx;
+ }
+
+ &:last-of-type {
+ margin-bottom: 16rpx;
+ }
+ }
+
+ .card-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: 10rpx;
+ padding-top: 16rpx;
+ border-top: 1rpx solid #ebeef5;
+ }
+ }
}
.load-more {
- padding: 20rpx;
+ padding: 20rpx 0;
}
diff --git a/mobile/src/pages/workStudy/applicationDetail.vue b/mobile/src/pages/workStudy/applicationDetail.vue
index 871ddd21..274911e0 100644
--- a/mobile/src/pages/workStudy/applicationDetail.vue
+++ b/mobile/src/pages/workStudy/applicationDetail.vue
@@ -1,11 +1,18 @@
+
+
+
+
+
+
+
申请状态
- 申请时间:
{{ applicationData.createTime }}
-
+
更新时间:
{{ applicationData.updateTime }}
@@ -32,11 +42,11 @@
{{ applicationData.positionName }}
-
+
岗位类型:{{ applicationData.positionType }}
-
+
工作地点:{{ applicationData.workLocation }}
@@ -61,7 +71,9 @@
联系电话:
- {{ applicationData.contactPhone }}
+
+ {{ applicationData.contactPhone }}
+
学院:
@@ -124,12 +136,12 @@
审核记录
-
+