purchase-let/pageQuota/balanceDetail/index.vue

150 lines
3.5 KiB
Vue
Raw Normal View History

2024-06-24 15:03:11 +08:00
<template>
<up-sticky bgColor="#fff">
<up-tabs :list="tabsLst" :itemStyle="{width:'33vw',paddingBottom:'20rpx'}" lineColor='#50C758' :current='mark'
@change="tabsChange"></up-tabs>
</up-sticky>
2024-06-24 16:51:25 +08:00
<block v-if="lists.length>0">
<view class="content" v-if='type==1||type==2'>
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
<text>{{item.title}}</text>
<text style="font-weight: bold;" :style="{color:item.type=='in'?'#50C758':'red'
}">{{ item.type=='in'?'+':'-' }}{{item.amount}}</text>
</view>
<view class="li-top" style="margin-bottom: 0;">
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
2024-06-28 19:53:27 +08:00
<text style="font-size: 24rpx;color: grey;">余额 {{item.balance}}</text>
2024-06-24 16:51:25 +08:00
</view>
2024-06-24 15:03:11 +08:00
</view>
2024-06-24 16:51:25 +08:00
</view>
2024-06-29 18:25:37 +08:00
<view class="content" v-if='type==3||type==5'>
2024-06-24 16:51:25 +08:00
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
<text>{{item.title}}</text>
2024-06-28 19:53:27 +08:00
<text style="font-weight: bold;" :style="{color:item.financial_pm?'#50C758':'red'
}">{{ item.financial_pm?'+':'-' }}{{item.number}}</text>
2024-06-24 16:51:25 +08:00
</view>
<view class="li-top" style="margin-bottom: 0;">
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
</view>
</view>
</view>
<view class="content" v-if='type==4'>
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
2024-07-05 18:18:02 +08:00
<text>{{item.title}}</text>
2024-06-24 18:40:03 +08:00
<text style="font-weight: bold;" :style="{color:!item.status?'#50C758':'red'
}">{{ !item.status?'+':'-' }}{{item.number}}</text>
2024-06-24 16:51:25 +08:00
</view>
<view class="li-top" style="margin-bottom: 0;">
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
</view>
2024-06-24 15:03:11 +08:00
</view>
</view>
2024-06-24 16:51:25 +08:00
</block>
<up-empty v-else mode="history" style="margin-top: 20vh;" text='没有更多内容了'>
</up-empty>
<view style="height: 50rpx;">
2024-06-24 15:03:11 +08:00
</view>
</template>
<script setup>
import {
ref,
reactive
} from "vue"
import {
2024-06-24 16:51:25 +08:00
onLoad,
onPullDownRefresh
2024-06-24 15:03:11 +08:00
} from "@dcloudio/uni-app"
import {
2024-06-29 18:25:37 +08:00
getFundList,
getUserSingList
2024-06-24 15:03:11 +08:00
} from "@/api/address.js"
2024-06-29 18:25:37 +08:00
const navLists = ['', '采购款明细', '余额明细', '礼品券明细', '返还金明细', '冻结券明细']
2024-06-24 15:03:11 +08:00
const tabsLst = reactive([{
name: '全部'
},
{
2024-06-24 18:40:03 +08:00
name: '收入'
2024-06-24 15:03:11 +08:00
},
{
2024-06-24 18:40:03 +08:00
name: '支出'
2024-06-24 15:03:11 +08:00
},
]);
const mark = ref(0)
const tabsChange = (e) => {
mark.value = e.index
2024-06-24 15:27:45 +08:00
getLists()
}
const lists = ref([])
2024-06-24 16:51:25 +08:00
let type = ref('')
const getLists = async (isPullDown = false) => {
2024-06-29 18:25:37 +08:00
if (type.value == 3 || type.value == 5) {
let res = await getUserSingList({
type: type.value == 3 ? 1 : 0,
page_no: 1,
page_size: 999,
mark: mark.value || ''
})
lists.value = res.data.lists
console.log(lists.value)
} else {
let res = await getFundList({
type: type.value,
mark: mark.value || ''
})
lists.value = res.data.lists
}
2024-06-24 16:51:25 +08:00
if (isPullDown) uni.stopPullDownRefresh()
2024-06-24 15:03:11 +08:00
2024-06-24 16:51:25 +08:00
}
2024-06-24 15:03:11 +08:00
onLoad((opt) => {
2024-06-24 16:51:25 +08:00
type.value = opt.type
uni.setNavigationBarTitle({
title: navLists[type.value]
})
2024-06-24 15:27:45 +08:00
getLists()
2024-06-24 15:03:11 +08:00
})
2024-06-24 16:51:25 +08:00
onPullDownRefresh(() => {
getLists(true)
})
2024-06-24 15:03:11 +08:00
</script>
<style lang="scss">
.content {
background-color: white;
width: 690rpx;
padding: 20rpx;
margin: 0 auto;
box-sizing: border-box;
margin: 0 auto;
margin-top: 30rpx;
border-radius: 20rpx;
2024-06-24 16:51:25 +08:00
margin-bottom: 100rpx;
2024-06-24 15:03:11 +08:00
.li {
margin-top: 20rpx;
border-bottom: 1px solid #EDF2FA;
padding-bottom: 20rpx;
.li-top {
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
}
}
}
</style>