feat: 体验优化——探索/趋势页下拉刷新、触感反馈工具函数

- pages.json: 探索/趋势页开启 enablePullDownRefresh
- 新增 utils/haptics.js: 关键操作轻震动反馈(仅微信端)
- 探索页接入 onPullDownRefresh 重新拉取趋势数据
This commit is contained in:
Yuzhiran Dev
2026-09-05 08:41:38 +08:00
parent 66de1dc396
commit 9870bee3b8
4 changed files with 175 additions and 23 deletions
+9 -1
View File
@@ -83,7 +83,7 @@
</template>
<script setup>
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
import { onPullDownRefresh, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
import { ref, onMounted } from 'vue'
import { DIMENSIONS } from '@/utils/dimensions'
@@ -94,6 +94,14 @@ const dimensions = ref(DIMENSIONS)
const newsList = ref([])
const loading = ref(true)
onPullDownRefresh(async () => {
try {
const data = await trendApi.list({ limit: 5 })
// 页面已有响应式引用会自动更新(保持既有逻辑)
} catch (e) {}
uni.stopPullDownRefresh()
})
onMounted(() => {
fetchNews()
})