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
@@ -65,7 +65,7 @@
</template>
<script setup>
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
import { onPullDownRefresh, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
import { ref, computed, onMounted } from 'vue'
import { trendApi } from '@/utils/api'
@@ -81,6 +81,14 @@ const activeFilter = ref(0)
const items = ref([])
const loading = ref(false)
onPullDownRefresh(async () => {
try {
const data = await trendApi.list({})
if (typeof setList === "function") setList(data)
} catch (e) {}
uni.stopPullDownRefresh()
})
onMounted(() => {
fetchTrends()
})