diff --git a/src/pages.json b/src/pages.json index 74b2adca..f4f72671 100644 --- a/src/pages.json +++ b/src/pages.json @@ -33,13 +33,29 @@ "navigationBarTitleText": "我的", "navigationStyle": "custom" } - }, + } + ], + "subPackages": [ { - "path": "pages/detail/detail", - "style": { - "navigationBarTitleText": "详情", - "navigationStyle": "custom" - } + "root": "pages/home", + "pages": [ + { + "path": "address-change", + "style": { + "navigationBarTitleText": "城市", + "navigationStyle": "default", + "navigationBarBackgroundColor": "#222222", + "navigationBarTextStyle": "white" + } + }, + { + "path": "detail", + "style": { + "navigationBarTitleText": "详情", + "navigationStyle": "custom" + } + } + ] } ], "globalStyle": { diff --git a/src/pages/home/address-change.vue b/src/pages/home/address-change.vue new file mode 100644 index 00000000..41879727 --- /dev/null +++ b/src/pages/home/address-change.vue @@ -0,0 +1,5 @@ + + + + + diff --git a/src/pages/detail/detail.vue b/src/pages/home/detail.vue similarity index 87% rename from src/pages/detail/detail.vue rename to src/pages/home/detail.vue index 083e5b33..b80eca91 100644 --- a/src/pages/detail/detail.vue +++ b/src/pages/home/detail.vue @@ -15,7 +15,18 @@ - + @@ -54,13 +65,28 @@ - {{ index }} + {{ index }} + + diff --git a/src/pages/home/home.vue b/src/pages/home/home.vue index 3b2c736f..ad4c1540 100644 --- a/src/pages/home/home.vue +++ b/src/pages/home/home.vue @@ -14,9 +14,9 @@ @@ -32,7 +32,6 @@ @refresherrefresh="onRefresherRefresh" @refresherabort="onRefresherAbort" @scrolltolower="onScrollToLower" - @scroll="onScroll" > @@ -78,13 +77,15 @@ const { const current = ref(0); const segmentedItems = ["广场", "最近", "新人"]; -const onScroll = (e: any) => { - // console.log('滚动:', e.detail); +const selectAddress = () => { + uni.navigateTo({ + url: "/pages/home/address-change", + }); }; const detail = () => { uni.navigateTo({ - url: "/pages/detail/detail", + url: "/pages/home/detail", }); }; diff --git a/src/pages/messages/messages.vue b/src/pages/messages/messages.vue index dab221bd..7facb97d 100644 --- a/src/pages/messages/messages.vue +++ b/src/pages/messages/messages.vue @@ -12,7 +12,7 @@ - + @@ -43,104 +43,7 @@ interface Message { unread: number; } -const messageList = ref([ - { - id: 1, - username: "晨晨", - avatar: "/static/avatar1.jpg", - lastMessage: "你好,很高兴认识你!", - time: "10:30", - unread: 2, - }, - { - id: 2, - username: "艾伯特", - avatar: "/static/avatar2.jpg", - lastMessage: "今天天气不错呢", - time: "09:15", - unread: 0, - }, - { - id: 3, - username: "粒儿云", - avatar: "/static/avatar3.jpg", - lastMessage: "晚上一起吃饭吗?", - time: "昨天", - unread: 1, - }, - { - id: 4, - username: "蓝天", - avatar: "/static/avatar4.jpg", - lastMessage: "周末有什么安排?", - time: "昨天", - unread: 0, - }, - { - id: 1, - username: "晨晨", - avatar: "/static/avatar1.jpg", - lastMessage: "你好,很高兴认识你!", - time: "10:30", - unread: 2, - }, - { - id: 2, - username: "艾伯特", - avatar: "/static/avatar2.jpg", - lastMessage: "今天天气不错呢", - time: "09:15", - unread: 0, - }, - { - id: 3, - username: "粒儿云", - avatar: "/static/avatar3.jpg", - lastMessage: "晚上一起吃饭吗?", - time: "昨天", - unread: 1, - }, - { - id: 4, - username: "蓝天", - avatar: "/static/avatar4.jpg", - lastMessage: "周末有什么安排?", - time: "昨天", - unread: 0, - }, - { - id: 1, - username: "晨晨", - avatar: "/static/avatar1.jpg", - lastMessage: "你好,很高兴认识你!", - time: "10:30", - unread: 2, - }, - { - id: 2, - username: "艾伯特", - avatar: "/static/avatar2.jpg", - lastMessage: "今天天气不错呢", - time: "09:15", - unread: 0, - }, - { - id: 3, - username: "粒儿云", - avatar: "/static/avatar3.jpg", - lastMessage: "晚上一起吃饭吗?", - time: "昨天", - unread: 1, - }, - { - id: 4, - username: "蓝天", - avatar: "/static/avatar4.jpg", - lastMessage: "周末有什么安排?", - time: "昨天", - unread: 0, - }, -]); +const messageList = ref(); const unreadCount = computed(() => { return messageList.value.reduce((total, message) => total + message.unread, 0); diff --git a/src/pages/moments/moments.vue b/src/pages/moments/moments.vue index 1abb1527..6db86741 100644 --- a/src/pages/moments/moments.vue +++ b/src/pages/moments/moments.vue @@ -1,251 +1,83 @@ diff --git a/src/pages/profile/profile.vue b/src/pages/profile/profile.vue index 23cd9d32..bb534ce9 100644 --- a/src/pages/profile/profile.vue +++ b/src/pages/profile/profile.vue @@ -23,7 +23,7 @@ {{ item.icon }} {{ item.text }} - > + @@ -55,36 +55,12 @@ const userInfo = ref({ }); const menuList = ref([ - { id: 1, icon: "👤", text: "个人资料" }, - { id: 2, icon: "💎", text: "会员中心" }, - { id: 3, icon: "🎁", text: "我的礼物" }, - { id: 4, icon: "❤️", text: "我的喜欢" }, - { id: 5, icon: "👥", text: "我的关注" }, - { id: 6, icon: "📸", text: "我的相册" }, - { id: 1, icon: "👤", text: "个人资料" }, - { id: 2, icon: "💎", text: "会员中心" }, - { id: 3, icon: "🎁", text: "我的礼物" }, - { id: 4, icon: "❤️", text: "我的喜欢" }, - { id: 5, icon: "👥", text: "我的关注" }, - { id: 6, icon: "📸", text: "我的相册" }, - { id: 1, icon: "👤", text: "个人资料" }, - { id: 2, icon: "💎", text: "会员中心" }, - { id: 3, icon: "🎁", text: "我的礼物" }, - { id: 4, icon: "❤️", text: "我的喜欢" }, - { id: 5, icon: "👥", text: "我的关注" }, - { id: 6, icon: "📸", text: "我的相册" }, - { id: 1, icon: "👤", text: "个人资料" }, - { id: 2, icon: "💎", text: "会员中心" }, - { id: 3, icon: "🎁", text: "我的礼物" }, - { id: 4, icon: "❤️", text: "我的喜欢" }, - { id: 5, icon: "👥", text: "我的关注" }, - { id: 6, icon: "📸", text: "我的相册" }, - { id: 1, icon: "👤", text: "个人资料" }, - { id: 2, icon: "💎", text: "会员中心" }, - { id: 3, icon: "🎁", text: "我的礼物" }, - { id: 4, icon: "❤️", text: "我的喜欢" }, - { id: 5, icon: "👥", text: "我的关注" }, - { id: 6, icon: "📸", text: "我的相册" }, + { id: 1, icon: "1", text: "个人资料" }, + { id: 2, icon: "2", text: "会员中心" }, + { id: 3, icon: "3", text: "我的礼物" }, + { id: 4, icon: "4", text: "我的喜欢" }, + { id: 5, icon: "5", text: "我的关注" }, + { id: 6, icon: "6", text: "我的相册" }, ]); @@ -180,9 +156,6 @@ const menuList = ref([ .menu-text { flex: 1; } - .menu-arrow { - color: #999; - } } } } diff --git a/src/sheep/hooks/use-scroll.ts b/src/sheep/hooks/use-scroll.ts index 67e560ad..5ff6ec63 100644 --- a/src/sheep/hooks/use-scroll.ts +++ b/src/sheep/hooks/use-scroll.ts @@ -21,6 +21,9 @@ export default function useScroll(fetchList: (...arg: any) => Promise) { const loadData = async (isRefresh: boolean = false) => { try { + if (pageInfo.current === 1) { + uni.showLoading({ title: "加载中..." }); + } if (isRefresh) { pageInfo.current = 1; const { total, data } = await fetchList(pageInfo.current); @@ -43,6 +46,8 @@ export default function useScroll(fetchList: (...arg: any) => Promise) { } catch (error) { console.error("加载数据失败:", error); return false; + } finally { + uni.hideLoading(); } };