From d4244fc783ed88bbba22c2eefa35d0a19aa44655 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Thu, 30 Oct 2025 19:09:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor(components):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E7=BB=84=E4=BB=B6=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=85=AC=E5=85=B1=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构了item-head、item-bottom、item-offer、item-summary和item-tenement组件,优化了props传递和数据处理逻辑 将公共头部和导航样式提取到public.css中,避免重复代码 修复了item-tenement组件中图片显示和数据处理的问题 更新了item-bottom组件的点赞和收藏逻辑,增加错误提示 优化了item-head组件的用户信息显示逻辑 调整了多个组件的样式细节,包括间距、图标大小等 --- component/head-top/head-top.js | 23 + component/head-top/head-top.txt | 26 + component/item-bottom/item-bottom.js | 21 +- component/item-bottom/item-bottom.txt | 10 +- component/item-forum/item-forum.js | 3 +- component/item-head/item-head.js | 4 +- component/item-head/item-head.txt | 6 +- component/item-offer/item-offer.js | 64 +- component/item-offer/item-offer.txt | 4 +- component/item-summary/item-summary.js | 12 +- component/item-summary/item-summary.txt | 4 +- component/item-tenement/item-tenement.js | 62 +- component/item-tenement/item-tenement.txt | 4 +- css/details.css | 71 +- css/details.less | 86 +- css/homepage-me.css | 142 +- css/homepage-me.less | 160 +- css/homepage-other.css | 129 +- css/homepage-other.less | 146 +- css/public.css | 150 +- css/public.less | 174 ++- css/search.css | 4 + css/search.less | 4 + css/section-index.css | 138 -- css/section-index.less | 157 -- details.html | 854 ++++++----- homepage-me.html | 109 +- homepage-other.html | 101 +- img/mj-icon.png | Bin 0 -> 6026 bytes index.html | 2 +- js/details.js | 503 ++++++- js/homepage-me.js | 1646 +++----------------- js/homepage-other.js | 1655 +++------------------ js/public.js | 48 +- js/save.js | 2 + js/search.js | 23 + js/section-index.js | 3 +- search.html | 27 + 38 files changed, 2092 insertions(+), 4485 deletions(-) create mode 100644 component/head-top/head-top.js create mode 100644 component/head-top/head-top.txt create mode 100644 css/search.css create mode 100644 css/search.less create mode 100644 img/mj-icon.png create mode 100644 js/search.js create mode 100644 search.html diff --git a/component/head-top/head-top.js b/component/head-top/head-top.js new file mode 100644 index 0000000..e53e4c9 --- /dev/null +++ b/component/head-top/head-top.js @@ -0,0 +1,23 @@ +// my-component.js +// 引入全局 Vue 对象(因在 HTML 中通过 script 引入,Vue 已挂载到 window) +const { defineComponent, ref, onMounted, nextTick } = Vue; + +// 定义组件(直接使用模板) +export const headTop = defineComponent({ + name: "headTop", + props: { + itemdata: { + type: Object, + default: () => {}, + }, + }, + + setup(props) { + onMounted(() => {}); + + let signInAlreadyState = ref(false); + return { signInAlreadyState }; + }, + + template: `
+
+
+
{{ item }}
{{ item.location || '九龙 > 尖沙咀/佐敦' }}
{{ item }}
{{ item.location || '九龙 > 尖沙咀/佐敦' }}
-
-
-
-
-
-