mirror of
https://github.com/Dichgrem/Vue.git
synced 2026-02-04 22:01:55 -05:00
update:finish
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"title": "运动会志愿者招募",
|
||||
"startTime": 1671494400000,
|
||||
"endTime": 1671697800000,
|
||||
"palce": "福州大学至诚学院",
|
||||
"place": "福州大学至诚学院",
|
||||
"content": "为确保运动会顺利进行,现招募志愿者协助现场秩序维护、运动员服务等工作。",
|
||||
"publisher": "福州大学至诚学院团委",
|
||||
"hour": 4,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"title": "运动会志愿者招募",
|
||||
"startTime": 1671494400000,
|
||||
"endTime": 1671697800000,
|
||||
"palce": "福州大学至诚学院",
|
||||
"place": "福州大学至诚学院",
|
||||
"isYourSchool": true,
|
||||
"canApply": false,
|
||||
"actPic": "./imgs/actImg.jpeg"
|
||||
@@ -20,7 +20,7 @@
|
||||
"title": "图书馆志愿服务",
|
||||
"startTime": 1670284800000,
|
||||
"endTime": 1670371200000,
|
||||
"palce": "福州市图书馆",
|
||||
"place": "福州市图书馆",
|
||||
"isYourSchool": false,
|
||||
"canApply": false,
|
||||
"actPic": "./imgs/actImg.jpeg"
|
||||
@@ -30,7 +30,7 @@
|
||||
"title": "社区敬老院服务",
|
||||
"startTime": 1672012800000,
|
||||
"endTime": 1672099200000,
|
||||
"palce": "福州市养老院",
|
||||
"place": "福州市养老院",
|
||||
"isYourSchool": false,
|
||||
"canApply": false,
|
||||
"actPic": "./imgs/actImg.jpeg"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"title": "社区敬老院服务",
|
||||
"startTime": 1672012800000,
|
||||
"endTime": 1672099200000,
|
||||
"palce": "福州市养老院",
|
||||
"place": "福州市养老院",
|
||||
"isYourSchool": false,
|
||||
"canApply": true,
|
||||
"actPic": "./imgs/actImg.jpeg",
|
||||
@@ -21,7 +21,7 @@
|
||||
"title": "运动会志愿者招募",
|
||||
"startTime": 1671494400000,
|
||||
"endTime": 1671697800000,
|
||||
"palce": "福州大学至诚学院",
|
||||
"place": "福州大学至诚学院",
|
||||
"isYourSchool": true,
|
||||
"canApply": true,
|
||||
"actPic": "./imgs/actImg.jpeg",
|
||||
@@ -32,7 +32,7 @@
|
||||
"title": "图书馆志愿服务",
|
||||
"startTime": 1670284800000,
|
||||
"endTime": 1670371200000,
|
||||
"palce": "福州市图书馆",
|
||||
"place": "福州市图书馆",
|
||||
"isYourSchool": false,
|
||||
"canApply": false,
|
||||
"actPic": "./imgs/actImg.jpeg",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"error": 0,
|
||||
"data": {
|
||||
"provinceRank": 156,
|
||||
"totalScore": 132,
|
||||
"totalScore": 180,
|
||||
"grandeRank": 8
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -9,6 +9,6 @@
|
||||
"school": "福州大学至诚学院",
|
||||
"profession": "计算机",
|
||||
"userType": 2,
|
||||
"totalScore": 132
|
||||
"totalScore": 180
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"error": 0,
|
||||
"data": {
|
||||
"avatar": "./imgs/avatar.png",
|
||||
"name": "李华",
|
||||
"totalScore": 132
|
||||
"name": "dich",
|
||||
"totalScore": 180
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,10 @@
|
||||
{
|
||||
"value": 2025,
|
||||
"text": "2025年"
|
||||
},
|
||||
{
|
||||
"value": 2026,
|
||||
"text": "2026年"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"error": 0,
|
||||
"data": {
|
||||
"times": 13,
|
||||
"duration": 50,
|
||||
"score": 100
|
||||
"times": 16,
|
||||
"duration": 74,
|
||||
"score": 180
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
{{ formatDate(data.endTime) }}
|
||||
</p>
|
||||
<p class="actItem-tag">
|
||||
{{ data.isYourSchool ? "本人所在学校活动" : data.palce }}
|
||||
{{ data.isYourSchool ? "本人所在学校活动" : data.place }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<div class="dataItem">
|
||||
<span class="label">活动地点</span>
|
||||
<p>{{ data.palce }}</p>
|
||||
<p>{{ data.place }}</p>
|
||||
</div>
|
||||
|
||||
<div class="dataItem">
|
||||
|
||||
@@ -53,8 +53,7 @@ export default {
|
||||
const searchTerm = this.keyword.trim().toLowerCase();
|
||||
return this.allActList.filter(item => {
|
||||
const title = (item.title || '').toLowerCase();
|
||||
// 注意:模拟数据中的字段是 'palce' 而不是 'place'
|
||||
const place = (item.palce || '').toLowerCase();
|
||||
const place = (item.place || '').toLowerCase();
|
||||
return title.includes(searchTerm) || place.includes(searchTerm);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="frm">
|
||||
<van-field
|
||||
v-model="pushlisher.text"
|
||||
v-model="publisher.text"
|
||||
is-link
|
||||
readonly
|
||||
label="活动来源"
|
||||
@@ -96,7 +96,7 @@ function dateRange() {
|
||||
};
|
||||
}
|
||||
|
||||
let pushlisherList = [];
|
||||
let publisherList = [];
|
||||
let durationList = [];
|
||||
|
||||
export default {
|
||||
@@ -104,7 +104,7 @@ export default {
|
||||
return {
|
||||
columns: [],
|
||||
pickerId: null,
|
||||
pushlisher: { value: null, text: "" },
|
||||
publisher: { value: null, text: "" },
|
||||
duration: { value: null, text: "" },
|
||||
date: null,
|
||||
content: "",
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
fieldCLick(value) {
|
||||
this.pickerId = value;
|
||||
if (value === 0) {
|
||||
this.columns = pushlisherList;
|
||||
this.columns = publisherList;
|
||||
} else if (value === 2) {
|
||||
this.columns = durationList;
|
||||
}
|
||||
@@ -144,7 +144,8 @@ export default {
|
||||
|
||||
if (curPickerId === 1) {
|
||||
const data = selectedValues;
|
||||
this.date = data.join(".");
|
||||
const [year, month, day] = data;
|
||||
this.date = `${year}-${month}-${day}`;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -155,7 +156,7 @@ export default {
|
||||
};
|
||||
|
||||
if (curPickerId === 0) {
|
||||
this.pushlisher = payload;
|
||||
this.publisher = payload;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -165,7 +166,7 @@ export default {
|
||||
axios.get("/api/act/publisherList").then(function (response) {
|
||||
const { error, data = {} } = response.data;
|
||||
if (error === 0) {
|
||||
pushlisherList = data.list || [];
|
||||
publisherList = data.list || [];
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -178,7 +179,7 @@ export default {
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
if (!this.pushlisher.text) {
|
||||
if (!this.publisher.text) {
|
||||
showToast("未选择活动来源");
|
||||
return;
|
||||
}
|
||||
@@ -200,7 +201,7 @@ export default {
|
||||
}
|
||||
|
||||
const payload = {
|
||||
pushlisher: this.pushlisher.value,
|
||||
publisher: this.publisher.value,
|
||||
date: +new Date(this.date),
|
||||
duration: this.duration.value,
|
||||
content: this.content,
|
||||
|
||||
@@ -151,7 +151,7 @@ function mockPlugin() {
|
||||
title: act.title,
|
||||
startTime: act.startTime,
|
||||
endTime: act.endTime,
|
||||
palce: act.palce,
|
||||
place: act.place,
|
||||
content: detailsTemplate.content || "活动详情待补充",
|
||||
publisher: detailsTemplate.publisher || "福州大学至诚学院团委",
|
||||
hour: detailsTemplate.hour || 4,
|
||||
@@ -218,8 +218,53 @@ function mockPlugin() {
|
||||
};
|
||||
return send(res, result);
|
||||
}
|
||||
if (pathname.startsWith("/api/service/details") && req.method === "GET")
|
||||
return sendJSON("recordDetails.json");
|
||||
if (pathname.startsWith("/api/service/details") && req.method === "GET") {
|
||||
const url = new URL(req.url, `http://${req.headers.host}`);
|
||||
const id = Number(url.searchParams.get("id"));
|
||||
|
||||
if (!id) {
|
||||
return send(res, { error: 1, msg: "missing id parameter" }, 400);
|
||||
}
|
||||
|
||||
const sl = readJson("serviceList.json", {
|
||||
error: 0,
|
||||
data: { current: 1, pageSize: 10, pageCount: 1, list: [] },
|
||||
});
|
||||
const record = (sl.data?.list || []).find((x) => Number(x.id) === id);
|
||||
|
||||
if (!record) {
|
||||
return send(res, { error: 1, msg: "record not found" }, 404);
|
||||
}
|
||||
|
||||
let placeText = record.publisher || "未知来源";
|
||||
if (typeof placeText === "number") {
|
||||
const publishers = readJson("publishers.json", {
|
||||
error: 0,
|
||||
data: { list: [] },
|
||||
});
|
||||
const publisherItem = (publishers.data?.list || []).find(
|
||||
(x) => x.value === placeText
|
||||
);
|
||||
placeText = publisherItem?.text || "未知来源";
|
||||
}
|
||||
|
||||
const result = {
|
||||
error: 0,
|
||||
data: {
|
||||
details: {
|
||||
actTime: record.time,
|
||||
place: placeText,
|
||||
content: record.content || "",
|
||||
imgList: record.imgList || [record.pic || "./imgs/actImg.jpeg"],
|
||||
hour: record.hour || 0,
|
||||
uploadTime: record.uploadTime || record.time || Date.now(),
|
||||
status: record.status || 0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return send(res, result);
|
||||
}
|
||||
|
||||
// ========== POST:全部改成“落盘” ==========
|
||||
// 1) 用户信息保存
|
||||
@@ -343,9 +388,12 @@ function mockPlugin() {
|
||||
const nextId =
|
||||
list.reduce((m, x) => Math.max(m, Number(x.id) || 0), 0) + 1;
|
||||
|
||||
const imgList = (incoming.fileList || []).map(item => item.url || item.content || incoming.pic || "./imgs/actImg.jpeg");
|
||||
|
||||
list.unshift({
|
||||
id: nextId,
|
||||
pic: incoming.pic || "./imgs/actImg.jpeg",
|
||||
imgList,
|
||||
content: incoming.content || "新增服务记录",
|
||||
publisher: incoming.publisher || "未知来源",
|
||||
time: incoming.time || Date.now(),
|
||||
|
||||
Reference in New Issue
Block a user