This commit is contained in:
@@ -182,8 +182,8 @@
|
||||
padding: 16rpx 8rpx;
|
||||
|
||||
.function-icon {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
width: 76rpx;
|
||||
height: 76rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y class="scroll-container" @scrolltolower="loadMore">
|
||||
<scroll-view scroll-y class="scroll-container" :style="scrollViewStyle" @scrolltolower="loadMore">
|
||||
<view v-if="orderList.length === 0 && !loading" class="empty-state">
|
||||
<image class="empty-icon" src="/static/order.png" mode="aspectFit" alt="我的订单"></image>
|
||||
<view class="empty-title">暂无订单</view>
|
||||
@@ -77,7 +77,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ref, reactive, computed, nextTick, onMounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { orderApi } from '@/api/index.js';
|
||||
import RenewalPaymentPopup from '@/components/RenewalPaymentPopup.vue';
|
||||
@@ -95,6 +95,7 @@
|
||||
const noMore = ref(false);
|
||||
const page = ref(1);
|
||||
const renewalPopupRef = ref(null);
|
||||
const scrollViewHeight = ref(0);
|
||||
const pageSize = 10;
|
||||
const filterIndex = ref(0);
|
||||
const filterOptions = [
|
||||
@@ -105,6 +106,26 @@
|
||||
{ label: '已退款', value: 4 }
|
||||
];
|
||||
|
||||
const scrollViewStyle = computed(() => scrollViewHeight.value > 0
|
||||
? { height: `${scrollViewHeight.value}px`, flex: 'none' }
|
||||
: {});
|
||||
|
||||
const updateScrollViewHeight = () => {
|
||||
const windowInfo = typeof uni.getWindowInfo === 'function'
|
||||
? uni.getWindowInfo()
|
||||
: uni.getSystemInfoSync();
|
||||
const windowHeight = Number(windowInfo?.windowHeight || 0);
|
||||
if (!windowHeight) return;
|
||||
|
||||
uni.createSelectorQuery()
|
||||
.select('.filter-tabs')
|
||||
.boundingClientRect((rect) => {
|
||||
if (!rect) return;
|
||||
scrollViewHeight.value = Math.max(Math.floor(windowHeight - rect.bottom), 1);
|
||||
})
|
||||
.exec();
|
||||
};
|
||||
|
||||
const getStatusClass = (status) => {
|
||||
const classMap = {
|
||||
1: 'tag-warning',
|
||||
@@ -238,6 +259,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
loadOrderList();
|
||||
nextTick(updateScrollViewHeight);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user