切换公司逻辑完善

This commit is contained in:
2024-04-11 21:13:52 +08:00
parent 222bae69d9
commit 93e9c5227b
24 changed files with 451 additions and 146 deletions

View File

@@ -10,7 +10,7 @@
<text class='secondary-text-color' style='flex: 1'>{{ item?.createtime }}</text>
<text style='color: #999999'>会员积分30.00</text>
</view>
<view class='divider' style='margin-top: 20rpx'/>
<!-- <view class='divider' style='margin-top: 20rpx'/>-->
<!-- </view>-->
</view>
</template>
@@ -28,7 +28,7 @@ defineProps({
display: flex;
flex-direction: column;
padding: 16rpx 23rpx 20rpx 30rpx;
margin: 20rpx 0;
margin: 10rpx 0;
}
.category-title {

View File

@@ -1,12 +1,14 @@
<template>
<view class='content'>
<view class='top-view c-flex-column'>
<text>{{ userInfo.integration }}</text>
<text>{{ userInfo?.integration }}</text>
<text>会员积分</text>
</view>
<text class='integral-detail-title'>积分明细</text>
<scroll-view style='margin: 10rpx 20rpx'>
<integral-item v-for='(item,index) in tradeList' :key='index' :item='item' />
<u-list @scrolltolower='loadMore'>
<integral-item v-for='(item,index) in tradeList' :key='index' :item='item' />
</u-list>
</scroll-view>
</view>
</template>
@@ -19,16 +21,26 @@ import { useUserStore } from '@/store';
const userStore = useUserStore();
const { userInfo } = storeToRefs(userStore);
const tradeList = ref([]);
const currentPageNum = ref(1);
onLoad((e) => {
fetchData();
});
const fetchData = async () => {
const fetchData = async (refresh: boolean = true) => {
currentPageNum.value = refresh ? 1 : currentPageNum.value + 1;
const { rows } = await getIntegralList({
fbean: { 'pageNum': 1, 'pageSize': 10, 'bean': {} }
fbean: { 'pageNum': currentPageNum.value, 'pageSize': 20, 'bean': {} }
});
tradeList.value = rows;
if(refresh) {
tradeList.value = rows;
} else {
tradeList.value = tradeList.value.concat(rows);
}
};
const loadMore = () => {
fetchData(false);
};
</script>