mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-11-13 22:11:42 +08:00
refactor: 优化滚动监听逻辑与评论系统,新增对齐alova的meta参数
1. 重构usePageScroll hook,支持自定义默认滚动值并暴露更新方法 2. 全局页面统一接入onPageScroll监听,替换原有内置日志打印 3. 新增评论可见回复数、回复引用、分页回复加载等评论扩展能力 4. 调整全局操作按钮位置与部分UI样式细节 5. 优化请求拦截器,对齐alova参数格式重构query处理逻辑 6. 完善评论弹窗与评论列表组件,实现抖音式折叠回复交互
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { onLoad, onPageScroll, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import dayjs from 'dayjs'
|
||||
import { getLoveAlbumByName, getLoveAlbums } from '@/api/uni-halo'
|
||||
import { useAppConfigStore } from '@/store/appConfig'
|
||||
@@ -20,7 +20,7 @@ definePage({
|
||||
},
|
||||
})
|
||||
|
||||
const { scrollY } = usePageScroll()
|
||||
const { scrollY, updatePageScrollValue } = usePageScroll()
|
||||
const appConfigStore = useAppConfigStore()
|
||||
const loveConfig = computed(() => appConfigStore.configs.loveConfig)
|
||||
|
||||
@@ -211,6 +211,10 @@ function handleToTopPage(duration = 500) {
|
||||
}
|
||||
|
||||
/* ---------------- 生命周期 ---------------- */
|
||||
onPageScroll((option: Page.PageScrollOption) => {
|
||||
updatePageScrollValue(option.scrollTop)
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
handleRestoreUnlockedAlbums()
|
||||
handleGetData()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { onLoad, onPageScroll, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { getLoveDailyItems } from '@/api/uni-halo'
|
||||
import { handleLoveModuleLocked } from '@/utils/loveModuleToken'
|
||||
import { checkImageUrl } from '@/utils/url'
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
})
|
||||
|
||||
const { scrollY } = usePageScroll()
|
||||
const { scrollY, updatePageScrollValue } = usePageScroll()
|
||||
|
||||
/* ---------------- 展示层类型 ---------------- */
|
||||
/** 清单展示卡片(script 预处理后的干净展示数据) */
|
||||
@@ -252,6 +252,10 @@
|
||||
}
|
||||
|
||||
/* ---------------- 生命周期 ---------------- */
|
||||
onPageScroll((option : Page.PageScrollOption) => {
|
||||
updatePageScrollValue(option.scrollTop)
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
handleGetList()
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, onBeforeUnmount, ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { onLoad, onPageScroll, onShow } from '@dcloudio/uni-app'
|
||||
import { useAppConfigStore } from '@/store/appConfig'
|
||||
import { checkAvatarUrl, checkImageUrl } from '@/utils/url'
|
||||
import { getPluginCaptcha, unlockLoveModule, type ICaptchaQuery, type IPluginCaptcha } from '@/api/uni-halo'
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
})
|
||||
|
||||
const { scrollY } = usePageScroll()
|
||||
const { scrollY, updatePageScrollValue } = usePageScroll()
|
||||
const appConfigStore = useAppConfigStore()
|
||||
|
||||
/* ---------------- 恋爱配置 ---------------- */
|
||||
@@ -205,6 +205,10 @@
|
||||
}
|
||||
|
||||
/* ---------------- 生命周期 ---------------- */
|
||||
onPageScroll((option : Page.PageScrollOption) => {
|
||||
updatePageScrollValue(option.scrollTop)
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
syncLoveConfigFromStore()
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { onLoad, onPageScroll, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
||||
import dayjs from 'dayjs'
|
||||
import { getLoveStories } from '@/api/uni-halo'
|
||||
import { handleLoveModuleLocked } from '@/utils/loveModuleToken'
|
||||
@@ -19,7 +19,7 @@
|
||||
},
|
||||
})
|
||||
|
||||
const { scrollY } = usePageScroll()
|
||||
const { scrollY, updatePageScrollValue } = usePageScroll()
|
||||
const appConfigStore = useAppConfigStore()
|
||||
|
||||
/* ---------------- 展示层类型 ---------------- */
|
||||
@@ -226,6 +226,10 @@
|
||||
}
|
||||
|
||||
/* ---------------- 生命周期 ---------------- */
|
||||
onPageScroll((option : Page.PageScrollOption) => {
|
||||
updatePageScrollValue(option.scrollTop)
|
||||
})
|
||||
|
||||
onLoad(() => {
|
||||
handleGetStories()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user