From b620d5c71d12a68d65974d57d7c73c7ade5b563f Mon Sep 17 00:00:00 2001 From: ctw Date: Mon, 17 Nov 2025 17:57:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=94=B6=E8=97=8F=E9=A1=B5=EF=BC=9B?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=9C=8B=E5=8F=8B=E5=9C=88=EF=BC=9B=E6=9A=97?= =?UTF-8?q?=E8=89=B2=E4=B8=BB=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.scss | 8 +- src/main.ts | 21 +- src/pages.json | 7 + src/pages/home/city.vue | 52 ++-- src/pages/home/detail.vue | 162 ++++++------ src/pages/home/home.vue | 144 +++++----- src/pages/login/login.vue | 165 ++++-------- src/pages/messages/messages.vue | 194 +++++--------- src/pages/moments/moments.vue | 43 ++- src/pages/moments/publish.vue | 68 ++++- src/pages/profile/like.vue | 98 +++++++ src/pages/profile/profile.vue | 169 ++++-------- src/pages/profile/userinfo.vue | 246 +++++++++--------- src/sheep/api/member/recent.ts | 26 ++ src/sheep/components/moment/moment.vue | 175 ++++--------- .../components/s-uploader/s-uploader.vue | 3 +- src/sheep/hooks/use-scroll.ts | 10 +- src/static/upload-icon.png | Bin 0 -> 1581 bytes src/uni.scss | 30 --- 19 files changed, 757 insertions(+), 864 deletions(-) create mode 100644 src/pages/profile/like.vue create mode 100644 src/static/upload-icon.png diff --git a/src/main.scss b/src/main.scss index 21ddc638..43cf570b 100644 --- a/src/main.scss +++ b/src/main.scss @@ -11,11 +11,7 @@ page { body, html { user-select: none; - background-color: $color-background; - color: $color-text; + background-color: #222222; + color: #ffffff; font-size: 14px; } - -:root { - --van-back-top-background: red; -} diff --git a/src/main.ts b/src/main.ts index ecc0f9a7..d505a544 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,16 +1,33 @@ import App from './App.vue'; -import { createSSRApp } from 'vue'; +import { createSSRApp, h, defineComponent } from 'vue'; // @ts-ignore import { setupPinia } from './sheep/store'; import './main.scss'; import 'virtual:uno.css'; import Vant from 'vant'; import 'vant/lib/index.css'; +import { ConfigProvider } from 'vant'; + +// 自定义vant组件颜色变量 +const THEME_VARS = { + primaryColor: '#ffcd32', + primaryColorDark: '#ffcd32', + primaryColorLight: '#ffcd32', + tabsBottomBarColor: '#ffcd32', +}; + +const AppWithConfigProvider = defineComponent({ + setup() { + return () => + h(ConfigProvider, { theme: 'dark', themeVars: THEME_VARS }, { default: () => h(App) }); + }, +}); export function createApp() { - const app = createSSRApp(App); + const app = createSSRApp(AppWithConfigProvider); setupPinia(app); app.use(Vant); + app.use(ConfigProvider); return { app, }; diff --git a/src/pages.json b/src/pages.json index 11b9411b..910d1340 100644 --- a/src/pages.json +++ b/src/pages.json @@ -77,6 +77,13 @@ "navigationBarTitleText": "修改资料", "navigationStyle": "custom" } + }, + { + "path": "like", + "style": { + "navigationBarTitleText": "喜欢", + "navigationStyle": "custom" + } } ] }, diff --git a/src/pages/home/city.vue b/src/pages/home/city.vue index 573392f6..76c08aee 100644 --- a/src/pages/home/city.vue +++ b/src/pages/home/city.vue @@ -1,34 +1,32 @@ - - diff --git a/src/pages/messages/messages.vue b/src/pages/messages/messages.vue index 7facb97d..24994f8f 100644 --- a/src/pages/messages/messages.vue +++ b/src/pages/messages/messages.vue @@ -1,134 +1,84 @@ - - diff --git a/src/pages/moments/moments.vue b/src/pages/moments/moments.vue index e0737398..8df81b3a 100644 --- a/src/pages/moments/moments.vue +++ b/src/pages/moments/moments.vue @@ -1,13 +1,17 @@ @@ -58,7 +62,12 @@ onRefresherAbort, onScrollToLower, onClickLoadMore, - } = useScroll(RecentApi.quickPage); + } = useScroll(RecentApi.quickPage, { + scene: 'DYNAMIC_RECOMMEND', + province: '', + city: '', + memberId: '', + }); const current = ref(0); const segmentedItems = ['动态', '附近']; @@ -69,25 +78,3 @@ }); }; - - diff --git a/src/pages/moments/publish.vue b/src/pages/moments/publish.vue index 514f22c9..aeffe4a3 100644 --- a/src/pages/moments/publish.vue +++ b/src/pages/moments/publish.vue @@ -1,21 +1,61 @@ diff --git a/src/pages/profile/profile.vue b/src/pages/profile/profile.vue index 3e48bbe6..2537207b 100644 --- a/src/pages/profile/profile.vue +++ b/src/pages/profile/profile.vue @@ -1,31 +1,58 @@ - + // type: 0-我喜欢 1-喜欢我 + const goLike = (type: 0 | 1) => { + uni.navigateTo({ + url: `/pages/profile/like?type=${type}`, + }); + }; + diff --git a/src/pages/profile/userinfo.vue b/src/pages/profile/userinfo.vue index 5a8f2caa..ad6f116e 100644 --- a/src/pages/profile/userinfo.vue +++ b/src/pages/profile/userinfo.vue @@ -1,133 +1,131 @@ - - diff --git a/src/sheep/components/s-uploader/s-uploader.vue b/src/sheep/components/s-uploader/s-uploader.vue index e0a37e34..044f4808 100644 --- a/src/sheep/components/s-uploader/s-uploader.vue +++ b/src/sheep/components/s-uploader/s-uploader.vue @@ -199,7 +199,8 @@ return { files: [], localValue: [], - imgsrc: sheep.$url.static('/static/img/shop/upload-camera.png'), + // imgsrc: sheep.$url.static('/static/img/shop/upload-camera.png'), + imgsrc: '/static/upload-icon.png', }; }, watch: { diff --git a/src/sheep/hooks/use-scroll.ts b/src/sheep/hooks/use-scroll.ts index 89d7b4f0..fa979fef 100644 --- a/src/sheep/hooks/use-scroll.ts +++ b/src/sheep/hooks/use-scroll.ts @@ -26,17 +26,17 @@ export default function useScroll(fetchList: (...arg: any) => Promise, fetc } if (isRefresh) { pageInfo.current = 1; - const { data } = await fetchList({ ...pageInfo, ...fetchBody }); - listData.value = data.list; + const { data = [] } = await fetchList({ ...pageInfo, ...fetchBody }); + listData.value = data.list ?? []; pageInfo.total = data.total; } else { - const { data } = await fetchList({ ...pageInfo, ...fetchBody }); - listData.value.push(...data.list); + const { data = [] } = await fetchList({ ...pageInfo, ...fetchBody }); + listData.value.push(...(data.list ?? [])); pageInfo.total = data.total; } pageInfo.current = pageInfo.current + 1; - if (listData.value.length >= pageInfo.total) { + if (listData.value?.length >= pageInfo.total) { loadMoreStatus.value = 'noMore'; } else { loadMoreStatus.value = 'more'; diff --git a/src/static/upload-icon.png b/src/static/upload-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5cb0cfa4eee6c772a2dfd495ae6897d6b3828862 GIT binary patch literal 1581 zcmV+|2GaS7P)o-_a7%-p%1 zQ~*D;QhW`42zvgrf4VdpbwNkHbn}%lkMlL7y zK*V#IJ|X0{fY{vuvJqJU%>q&lr1AHQF9RSMj6WK+a?kjO6gE-~B!zm1mK+a|(6sCj zqyPg6QYN8(29l8QL1`ICkTMDNGmwOY4@%2Gf|N<9pMfMKd{9~j5~NH*{R|`_;e*mL zkRW9e>Q57pgd|d%mVv0%J2V>u36)5#0|Qa3cW5>S5-O2e2L_^6@6c=vBvc}`4h%%C z-l5qTNT@_=9T%c(N>K&Sm zfrLt=)`5Yj)jKpB0|}K#tpfv5t9NKN1`;Y!OAajuF_4y}izkqQ#G`A=qcV_|rHdz! zfyAS0%cC-omZgg)kb%UbYs;ff3FN_pc`rD1v%6U@f7+;-dzyCXW5+JFHG%A1qb7<#V8Z=}u5Wsp+5cfZ$0uqLUMhFCwD_T8t`2P|V$oe$@$M~SR^?{4VBMIRuU^mQ?_SI1 zD_3U}t5-TYtCw@d%B7B3m7htZi@ALDLPx&xlaaU18^!85qqFj(QK+1qQLxTr3)Sx_ z?sTqboyz8|Z*s-z$y}jwqN8AaWfZE%jjqZuBVRdc6s;pP_F;-UWE8A}xvuJG6nh|7 zwDyzr;H>*Y6Uu$884BdF2+cbLO4^|{FLH|V+71W+G7!+{A?bv!Q8|%I;UgrnWbp>H z9T1N$YvPqG-qG6*h~POS-aRJr=z=Hph?>Rh?gGv0G3SVJcoE~+$qX%MX_!prY027l zKqR1?7G)9|r0swJ@Eig__9|g8~~ojle$(!1Yh=Q#REX{ zRhAY+#)@zW$yhs$?`^jZ5xfr3Y(L~VL^B{RUuEec8&8_Q%Eh&C|%LfjFTf9>^!(8a{G9wF+tN~lj6Z$@{7*CFvL9C37>Lm~JtMe(Te)B}068SV4RKr~~?Kp2Q-3TRdiA0e6n`5yoP|Nmcgychrg f00v1!K~w_(7FOTqlkcA-00000NkvXXu0mjfuW;!a literal 0 HcmV?d00001 diff --git a/src/uni.scss b/src/uni.scss index c39c7b7b..f7e0a709 100644 --- a/src/uni.scss +++ b/src/uni.scss @@ -74,33 +74,3 @@ $uni-color-subtitle: #555; // 二级标题颜色 $uni-font-size-subtitle: 18px; $uni-color-paragraph: #3f536e; // 文章段落颜色 $uni-font-size-paragraph: 15px; - -// --------------------------------------------------------------------------------------------- - -// 自定义scss变量 -// 颜色 -$color-background: #222222; -$color-background-d: rgba(0, 0, 0, 0.3); -$color-highlight-background: #333; -$color-theme: #ffcd32; -$color-theme-d: rgba(255, 205, 49, 0.5); -$color-sub-theme: #d93f30; -$color-text: #ffffff; -$color-text-d: rgba(255, 255, 255, 0.3); -$color-text-l: rgba(255, 255, 255, 0.5); -$color-text-ll: rgba(255, 255, 255, 0.8); -$color-dialog-background: #666; - -// 字体 -$font-size-small-s: 10px; -$font-size-small: 12px; -$font-size-medium: 14px; -$font-size-medium-x: 16px; -$font-size-large: 18px; -$font-size-large-x: 22px; - -@mixin no-wrap() { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -}