This commit is contained in:
@@ -182,8 +182,8 @@
|
|||||||
padding: 16rpx 8rpx;
|
padding: 16rpx 8rpx;
|
||||||
|
|
||||||
.function-icon {
|
.function-icon {
|
||||||
width: 88rpx;
|
width: 76rpx;
|
||||||
height: 88rpx;
|
height: 76rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</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">
|
<view v-if="orderList.length === 0 && !loading" class="empty-state">
|
||||||
<image class="empty-icon" src="/static/order.png" mode="aspectFit" alt="我的订单"></image>
|
<image class="empty-icon" src="/static/order.png" mode="aspectFit" alt="我的订单"></image>
|
||||||
<view class="empty-title">暂无订单</view>
|
<view class="empty-title">暂无订单</view>
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, computed, nextTick, onMounted } from 'vue';
|
||||||
import { onShow } from '@dcloudio/uni-app';
|
import { onShow } from '@dcloudio/uni-app';
|
||||||
import { orderApi } from '@/api/index.js';
|
import { orderApi } from '@/api/index.js';
|
||||||
import RenewalPaymentPopup from '@/components/RenewalPaymentPopup.vue';
|
import RenewalPaymentPopup from '@/components/RenewalPaymentPopup.vue';
|
||||||
@@ -95,6 +95,7 @@
|
|||||||
const noMore = ref(false);
|
const noMore = ref(false);
|
||||||
const page = ref(1);
|
const page = ref(1);
|
||||||
const renewalPopupRef = ref(null);
|
const renewalPopupRef = ref(null);
|
||||||
|
const scrollViewHeight = ref(0);
|
||||||
const pageSize = 10;
|
const pageSize = 10;
|
||||||
const filterIndex = ref(0);
|
const filterIndex = ref(0);
|
||||||
const filterOptions = [
|
const filterOptions = [
|
||||||
@@ -105,6 +106,26 @@
|
|||||||
{ label: '已退款', value: 4 }
|
{ 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 getStatusClass = (status) => {
|
||||||
const classMap = {
|
const classMap = {
|
||||||
1: 'tag-warning',
|
1: 'tag-warning',
|
||||||
@@ -238,6 +259,7 @@
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadOrderList();
|
loadOrderList();
|
||||||
|
nextTick(updateScrollViewHeight);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user