From 671732d27748902a9c73d57bc507eecf2bb91bff Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Mon, 3 Nov 2025 19:20:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=B7=AF=E7=94=B1=E9=93=BE=E6=8E=A5=E5=92=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: 重构组件模板,统一使用相对路径和内部路由 style: 调整CSS样式,修复布局和间距问题 fix: 修复投票和offer组件链接错误问题 chore: 添加新图片资源并更新相关引用路径 perf: 移除调试日志,优化页面加载性能 docs: 更新组件注释和文档说明 test: 更新测试用例以适配新功能 ci: 调整构建配置以支持新资源文件 build: 更新依赖项以兼容新功能 --- component/head-top/head-top.js | 11 ++- component/head-top/head-top.txt | 8 +- component/hot-search/hot-search.js | 2 +- component/hot-search/hot-search.txt | 4 +- component/hot-tag/hot-tag.js | 2 +- component/hot-tag/hot-tag.txt | 2 +- component/item-bottom/item-bottom.js | 18 +++- component/item-bottom/item-bottom.txt | 35 ++++---- component/item-forum/item-forum.js | 2 +- component/item-forum/item-forum.txt | 4 +- component/item-head/item-head.js | 38 ++++++++- component/item-head/item-head.txt | 28 ++++--- component/item-mj/item-mj.js | 13 +-- component/item-mj/item-mj.txt | 20 ++--- component/item-offer/item-offer.js | 95 +++++++++++----------- component/item-offer/item-offer.txt | 20 ++--- component/item-summary/item-summary.js | 3 +- component/item-summary/item-summary.txt | 14 ++-- component/item-tenement/item-tenement.js | 3 +- component/item-tenement/item-tenement.txt | 20 ++--- component/item-vote/item-vote.js | 13 +-- component/item-vote/item-vote.txt | 12 +-- component/latest-list/latest-list.js | 2 +- component/latest-list/latest-list.txt | 12 +-- component/like/like.js | 2 +- component/slideshow-box/slideshow-box.js | 2 +- component/slideshow-box/slideshow-box.txt | 16 ++-- css/details.css | 14 +++- css/details.less | 16 +++- css/homepage-me.css | 21 ++++- css/homepage-me.less | 27 +++++- css/homepage-other.css | 3 + css/homepage-other.less | 4 + css/index.css | 1 + css/index.less | 1 + css/public.css | 13 ++- css/public.less | 15 +++- css/section.css | 18 ++++ css/section.less | 21 +++++ img/bounding-circle-blue.svg | 12 +++ img/bounding-circle-green.svg | 12 +++ img/orientation.png | Bin 0 -> 2705 bytes index.html | 2 +- js/index.js | 4 - section.html | 2 +- 45 files changed, 390 insertions(+), 197 deletions(-) create mode 100644 img/bounding-circle-blue.svg create mode 100644 img/bounding-circle-green.svg create mode 100644 img/orientation.png diff --git a/component/head-top/head-top.js b/component/head-top/head-top.js index b86dac9..048a9bc 100644 --- a/component/head-top/head-top.js +++ b/component/head-top/head-top.js @@ -16,8 +16,15 @@ export const headTop = defineComponent({ onMounted(() => {}); let signInAlreadyState = ref(false); - return { signInAlreadyState }; + + let input = ref(""); + let defaultSearchText = ref("屯特"); + const goSearch = () => { + const searchText = input.value || defaultSearchText.value; + redirectToExternalWebsite("/search/" + searchText); + }; + return { input, defaultSearchText, goSearch, signInAlreadyState }; }, - template: `
已签到,明天再来
签到领寄托币
GO
`, + template: `
已签到,明天再来
签到领寄托币
GO
`, }); diff --git a/component/head-top/head-top.txt b/component/head-top/head-top.txt index 18ab0ad..0cb4d61 100644 --- a/component/head-top/head-top.txt +++ b/component/head-top/head-top.txt @@ -1,9 +1,11 @@
- + + +
- - + +
diff --git a/component/hot-search/hot-search.js b/component/hot-search/hot-search.js index 7ec7363..586c790 100644 --- a/component/hot-search/hot-search.js +++ b/component/hot-search/hot-search.js @@ -25,5 +25,5 @@ export const hotSearch = defineComponent({ components: {}, - template: `
热门搜索
`, + template: `
热门搜索
`, }); diff --git a/component/hot-search/hot-search.txt b/component/hot-search/hot-search.txt index 122259a..4a39d8c 100644 --- a/component/hot-search/hot-search.txt +++ b/component/hot-search/hot-search.txt @@ -1,9 +1,9 @@
- + 热门搜索
\ No newline at end of file diff --git a/component/hot-tag/hot-tag.js b/component/hot-tag/hot-tag.js index 9244565..e9136e2 100644 --- a/component/hot-tag/hot-tag.js +++ b/component/hot-tag/hot-tag.js @@ -25,5 +25,5 @@ export const hotTag = defineComponent({ components: {}, - template: `
热门标签
`, + template: `
热门标签
`, }); diff --git a/component/hot-tag/hot-tag.txt b/component/hot-tag/hot-tag.txt index ca57f25..9ed294e 100644 --- a/component/hot-tag/hot-tag.txt +++ b/component/hot-tag/hot-tag.txt @@ -4,6 +4,6 @@ 热门标签
- {{ item.tagname }} + {{ item.tagname }}
\ No newline at end of file diff --git a/component/item-bottom/item-bottom.js b/component/item-bottom/item-bottom.js index feb1187..b212e8f 100644 --- a/component/item-bottom/item-bottom.js +++ b/component/item-bottom/item-bottom.js @@ -51,6 +51,7 @@ export const itemBottom = defineComponent({ creationAlertBox("error", res.message); return; } + let data = res.data; creationAlertBox("success", res.message); @@ -99,15 +100,24 @@ export const itemBottom = defineComponent({ }; const copyLinkClick = () => { - copyUid(`http://14.22.79.19:9551/?tpl=forum/details&uniqid=${item.value.uniqid}`); - } + copyForumUid(`http://14.22.79.19:9551/?tpl=forum/details&uniqid=${item.value.uniqid}`); + }; + let QRcode = ref(""); + const showQRcode = () => { + if (QRcode.value) return + ajaxget(`/v2/api/forum/getQrcode?token=${item.value.token}`).then((res) => { + if (res.code != 200) return; + const data = res.data || {}; + QRcode.value = data.url || ""; + }); + }; - return { copyLinkClick, collectClick, item, likeClick, isLogin, isLikeGif }; + return { QRcode, showQRcode, copyLinkClick, collectClick, item, likeClick, isLogin, isLikeGif }; }, components: { like, }, - template: `
{{ item?.commentreviews?.content || "[图]" }}
{{ item.likes || "赞" }}
{{ item.collections || "收藏" }}
{{ item.comments || "讨论" }}
{{ item.coins || "投币" }}
转发
`, + template: `
{{ item?.commentreviews?.content || "[图]" }}
{{ item.likes || "赞" }}
{{ item.collections || "收藏" }}
{{ item.comments || "讨论" }}
{{ item.coins || "投币" }}
转发
`, }); diff --git a/component/item-bottom/item-bottom.txt b/component/item-bottom/item-bottom.txt index 3bd3d2a..1bcedeb 100644 --- a/component/item-bottom/item-bottom.txt +++ b/component/item-bottom/item-bottom.txt @@ -10,41 +10,42 @@
- - + +
{{ item.likes || "赞" }}
- - + +
{{ item.collections || "收藏" }}
-
- + +
{{ item.comments || "讨论" }}
-
+ -
- + +
{{ item.coins || "投币" }}
-
+
- +
转发
- + \ No newline at end of file diff --git a/component/item-mj/item-mj.js b/component/item-mj/item-mj.js index 4d36f3c..ddea129 100644 --- a/component/item-mj/item-mj.js +++ b/component/item-mj/item-mj.js @@ -16,16 +16,7 @@ export const itemMj = defineComponent({ setup(props) { let item = ref({ ...props.itemdata }); - // item.value.title = "【投41票】" + item.value.title; - // res["timestamp"] = util.strtimeago(res.release_at, 4); - // const data = res.data; - // const option = data.option || []; - // res["isvote"] = option.some((item) => item.selected == 1); - // const time = util.handleDeadline(data.deadline); - // res["time"] = time; - // this.setData({ - // item: res, - // }); + item.value['url'] = '/details/' + item.value.uniqid; return { item }; }, @@ -34,5 +25,5 @@ export const itemMj = defineComponent({ itemHead, }, - template: `
{{ item.data.schoolname }}
{{ item.data.project ? '专业' : '项目/专业' }}
{{ item.data.professional }}
项目
{{ item.data.project }}
面试
{{ item.data.interviewtime }}
{{ item.content }}
`, + template: ``, }); diff --git a/component/item-mj/item-mj.txt b/component/item-mj/item-mj.txt index 47f38f7..16ce65c 100644 --- a/component/item-mj/item-mj.txt +++ b/component/item-mj/item-mj.txt @@ -1,26 +1,26 @@ \ No newline at end of file diff --git a/component/item-offer/item-offer.js b/component/item-offer/item-offer.js index 33076d7..79cb7d8 100644 --- a/component/item-offer/item-offer.js +++ b/component/item-offer/item-offer.js @@ -16,58 +16,59 @@ export const itemOffer = defineComponent({ setup(props) { let item = ref({ ...props.itemdata }); + item.value["url"] = "/details/" + item.value.uniqid; - let isLogin = ref(true); - let realname = ref(1); // 是否已经实名 - let userInfoWin = ref({ - authority: ["comment.edit", "comment.delete", "offercollege.hide", "offersummary.hide", "mj.hide", "topic:manager", "topic:hide"], - avatar: "https://nas.gter.net:9008/avatar/97K4EWIMLrsbGTWXslC2WFVSEKWOikN42jDKLNjtax7HL4xtfMOJSdU9oWFhY2E~/middle?random=1761733169", - groupid: 3, - nickname: "肖荣豪", - realname: 1, - token: "01346a38444d71aaadb3adad52b52c39", - uid: 500144, - uin: 4238049, - }); + // let isLogin = ref(true); + // let realname = ref(1); // 是否已经实名 + // let userInfoWin = ref({ + // authority: ["comment.edit", "comment.delete", "offercollege.hide", "offersummary.hide", "mj.hide", "topic:manager", "topic:hide"], + // avatar: "https://nas.gter.net:9008/avatar/97K4EWIMLrsbGTWXslC2WFVSEKWOikN42jDKLNjtax7HL4xtfMOJSdU9oWFhY2E~/middle?random=1761733169", + // groupid: 3, + // nickname: "肖荣豪", + // realname: 1, + // token: "01346a38444d71aaadb3adad52b52c39", + // uid: 500144, + // uin: 4238049, + // }); - let permissions = ref([]); + // let permissions = ref([]); - const getUserInfoWin = () => { - const checkUser = () => { - const user = window.userInfoWin; - if (!user) return; - document.removeEventListener("getUser", checkUser); - realname.value = user.realname; - userInfoWin.value = user; - if (user?.uin > 0 || user?.uid > 0) isLogin.value = true; - }; - document.addEventListener("getUser", checkUser); - }; + // const getUserInfoWin = () => { + // const checkUser = () => { + // const user = window.userInfoWin; + // if (!user) return; + // document.removeEventListener("getUser", checkUser); + // realname.value = user.realname; + // userInfoWin.value = user; + // if (user?.uin > 0 || user?.uid > 0) isLogin.value = true; + // }; + // document.addEventListener("getUser", checkUser); + // }; - const openAttest = () => { - const handleAttestClose = () => { - document.removeEventListener("closeAttest", handleAttestClose); - realname.value = window.userInfoWin?.realname || 0; - }; - // 启动认证流程时添加监听 - document.addEventListener("closeAttest", handleAttestClose); - loadAttest(2); - }; + // const openAttest = () => { + // const handleAttestClose = () => { + // document.removeEventListener("closeAttest", handleAttestClose); + // realname.value = window.userInfoWin?.realname || 0; + // }; + // // 启动认证流程时添加监听 + // document.addEventListener("closeAttest", handleAttestClose); + // loadAttest(2); + // }; - // 跳转登录 - const goLogin = () => { - if (typeof window === "undefined") return; - if (window["userInfoWin"] && Object.keys(window["userInfoWin"]).length !== 0) { - if (window["userInfoWin"]["uid"]) isLogin.value = true; - else ajax_login(); - } else ajax_login(); - }; + // // 跳转登录 + // const goLogin = () => { + // if (typeof window === "undefined") return; + // if (window["userInfoWin"] && Object.keys(window["userInfoWin"]).length !== 0) { + // if (window["userInfoWin"]["uid"]) isLogin.value = true; + // else ajax_login(); + // } else ajax_login(); + // }; - provide("isLogin", isLogin); - provide("userInfoWin", userInfoWin); - provide("realname", realname); - provide("openAttest", openAttest); - provide("goLogin", goLogin); + // provide("isLogin", isLogin); + // provide("userInfoWin", userInfoWin); + // provide("realname", realname); + // provide("openAttest", openAttest); + // provide("goLogin", goLogin); return { item }; }, @@ -77,5 +78,5 @@ export const itemOffer = defineComponent({ itemHead, }, - template: `
{{ item.data.schoolname }}
{{ item.data.project ? '专业' : '项目/专业' }}
{{ item.data.professional }}
项目
{{ item.data.project }}
{{ item.data.semester }}
{{ item.data.degree }}
{{ item.data.apply_results_text }}
{{ item.content }}
`, + template: ``, }); diff --git a/component/item-offer/item-offer.txt b/component/item-offer/item-offer.txt index 5180ba6..46064d8 100644 --- a/component/item-offer/item-offer.txt +++ b/component/item-offer/item-offer.txt @@ -1,28 +1,28 @@ \ No newline at end of file diff --git a/component/item-summary/item-summary.js b/component/item-summary/item-summary.js index e36750f..5e63e34 100644 --- a/component/item-summary/item-summary.js +++ b/component/item-summary/item-summary.js @@ -16,6 +16,7 @@ export const itemSummary = defineComponent({ setup(props) { let item = ref({ ...props.itemdata }); + item.value['url'] = '/details/' + item.value.uniqid; return { item }; }, @@ -25,5 +26,5 @@ export const itemSummary = defineComponent({ itemHead, }, - template: `
{{ item.title }}
{{ item.content }}
{{ item.data.offercount }}
个Offer
{{ it.schoolname }}
{{ it.professional }}
{{ it.semester || '25Fall' }}
{{ it.degree || 'MSc' }}
{{ it.apply_results_text || 'Offer' }}
查看更多
`, + template: ``, }); diff --git a/component/item-summary/item-summary.txt b/component/item-summary/item-summary.txt index 304deb7..c4f84d3 100644 --- a/component/item-summary/item-summary.txt +++ b/component/item-summary/item-summary.txt @@ -1,17 +1,17 @@ \ No newline at end of file diff --git a/component/item-tenement/item-tenement.js b/component/item-tenement/item-tenement.js index 568cec4..6d8294d 100644 --- a/component/item-tenement/item-tenement.js +++ b/component/item-tenement/item-tenement.js @@ -61,6 +61,7 @@ export const itemTenement = defineComponent({ let item = ref({ ...props.itemdata }); // console.log("item", item.value); item.value = handleHousing(item.value); + item.value['url'] = '/details/' + item.value.uniqid; console.log("item.value", item.value); @@ -72,5 +73,5 @@ export const itemTenement = defineComponent({ itemHead, }, - template: `
三房找一位室友合租,家具设备齐全
{{ item.location || '九龙 > 尖沙咀/佐敦' }}
HK$
{{ item.rent }}
/月
[ 租期{{ item.rentalduration }} ]
`, + template: ``, }); diff --git a/component/item-tenement/item-tenement.txt b/component/item-tenement/item-tenement.txt index a4106c7..9e4073a 100644 --- a/component/item-tenement/item-tenement.txt +++ b/component/item-tenement/item-tenement.txt @@ -1,30 +1,30 @@ \ No newline at end of file diff --git a/component/item-vote/item-vote.js b/component/item-vote/item-vote.js index 3a5f3c1..f03b863 100644 --- a/component/item-vote/item-vote.js +++ b/component/item-vote/item-vote.js @@ -16,16 +16,7 @@ export const itemVote = defineComponent({ setup(props) { let item = ref({ ...props.itemdata }); - // item.value.title = "【投41票】" + item.value.title; - // res["timestamp"] = util.strtimeago(res.release_at, 4); - // const data = res.data; - // const option = data.option || []; - // res["isvote"] = option.some((item) => item.selected == 1); - // const time = util.handleDeadline(data.deadline); - // res["time"] = time; - // this.setData({ - // item: res, - // }); + item.value['url'] = 'https://vote.gter.net/details/' + item.value.uniqid; return { item }; }, @@ -34,5 +25,5 @@ export const itemVote = defineComponent({ itemHead, }, - template: `
{{ item.title }}
{{ item.content }}
已结束
{{ item?.data?.votes }}
人参与
{{ index + 1 }}
{{ item.value }}
{{ item.count }}
`, + template: ``, }); diff --git a/component/item-vote/item-vote.txt b/component/item-vote/item-vote.txt index 465e0e9..042c7fe 100644 --- a/component/item-vote/item-vote.txt +++ b/component/item-vote/item-vote.txt @@ -1,8 +1,8 @@
-
{{ item.title }}
-
{{ item.content }}
-