优化全局下拉刷新
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 列表区域 -->
|
||||
<scroll-view class="page" scroll-y>
|
||||
<view class="page">
|
||||
<view class="page-container">
|
||||
<view v-if="dataList.length === 0" class="empty-state">
|
||||
<uni-icons type="info" size="30" color="#ccc"></uni-icons>
|
||||
@@ -42,7 +42,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-btn-wrap">
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import {onLoad, onShow} from '@dcloudio/uni-app'
|
||||
import {onLoad, onShow, onPullDownRefresh} from '@dcloudio/uni-app'
|
||||
import {getComplainList} from '../api/apiSub.js'
|
||||
|
||||
// 分段器
|
||||
@@ -111,6 +111,8 @@ const getComplainListData = async () =>{
|
||||
}catch(err){
|
||||
// console.log('dess',err)
|
||||
uni.showToast({title:err.msg || '网络异常',icon:'error'})
|
||||
}finally{
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
onLoad(() =>{
|
||||
@@ -118,7 +120,11 @@ onLoad(() =>{
|
||||
})
|
||||
onShow(() => {
|
||||
getComplainListData()
|
||||
})
|
||||
});
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
getComplainListData();
|
||||
});
|
||||
|
||||
// 跳转到详情
|
||||
const turnToDetail = (item) => {
|
||||
@@ -149,16 +155,12 @@ const addComplaintsSuggestions = () => {
|
||||
|
||||
<style scoped>
|
||||
.contentStyle {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
min-height: 100vh;
|
||||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
||||
}
|
||||
|
||||
.page {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0px 40rpx;
|
||||
padding: 0px 40rpx 200rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -183,6 +185,10 @@ const addComplaintsSuggestions = () => {
|
||||
}
|
||||
|
||||
.tab-wrap {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
background: #e2efff;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
@@ -310,9 +316,15 @@ const addComplaintsSuggestions = () => {
|
||||
}
|
||||
|
||||
.bottom-btn-wrap {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 10;
|
||||
padding: 20rpx 30rpx 40rpx;
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.next-btn {
|
||||
|
||||
Reference in New Issue
Block a user