Files
vpUni/.svn/pristine/f6/f65630e9780f25367fd4f1e5ae738830cd46bcde.svn-base
2026-03-09 16:39:03 +08:00

153 lines
4.3 KiB
Plaintext

<template>
<view>
<view class="" style=" margin: 25rpx 0; padding: 0 20rpx; display: flex; align-items: center; justify-content: space-between;">
<view @click="changetab(index)" v-for="(item,index) in tag" :key="index"
:class="{active:index!=currentIndex,actived:index==currentIndex}" class="tag"
style=" padding: 14rpx 36rpx; border-radius: 14rpx; ">
{{item}}
</view>
</view>
<view v-if="type==0"class="" style=" margin:20rpx; margin-top: 30rpx; " >
<view class="" style="display: flex; align-items: center; padding: 40rpx 30rpx; margin-top: 20rpx; justify-content: space-between; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #e2e2e2; " >
<view class="">
<view class="" style="display: flex; align-items: center;" >
<img :src="Service.GetMateUrlByImg('/static/dele/dele1.jpg')" style=" border-radius: 10rpx; width: 60rpx; height: 60rpx;" alt="" />
<text style="margin-left: 10rpx;" >星巴克咖啡</text>
</view>
<view class="" style="margin-top: 15rpx; color: #999999; " >
今天 14:30
</view>
</view>
<view class="" style="font-weight: 600; color: #666666;" >
¥-38.00
</view>
</view>
<up-loadmore :status="status" />
</view>
<view v-else class="" style=" margin:20rpx; margin-top: 30rpx; " >
<view class="" v-for="(item,index) in historyList" :key="index" style="display: flex; align-items: center; padding: 40rpx 30rpx; margin-top: 20rpx; justify-content: space-between; border-radius: 20rpx; box-shadow: 0 0 10rpx 4rpx #e2e2e2; " >
<view class="">
<view class="" style="display: flex; align-items: center; gap: 20rpx; " >
<img :src="Service.GetMateUrlByImg(item.merchLogo)" style=" border-radius: 10rpx; width: 110rpx; height: 110rpx;" alt="" />
<view class="">
<view style="font-weight: bold; font-size: 32rpx; " >{{ item.merchName }}</view>
<view class="" style="margin-top: 15rpx; color: #999999; font-size: 26rpx; " >
{{ item.payTime }}
</view>
</view>
</view>
</view>
<view class="" style="font-weight: 600; font-size: 34rpx; " >
-{{ item.amount }}
</view>
</view>
<up-loadmore :status="status" />
</view>
<up-calendar :show="showDate" closeOnClickOverlay='true' :mode="mode" monthNum='5' minDate='2025-12-01' maxDate='2999-12-31' @close="showDate=false" @confirm="confirmDate"></up-calendar>
</view>
</template>
<script setup lang="ts">
import { onShow, onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { Service } from '@/Service/Service'
import { vpOrderService } from '@/Service/vp/vpOrderService'
let currentIndex=ref(0)
let tag = ref([
'全部',
'今日',
'本月',
'自定义'
])
// 日历管理
const showDate = ref(false);
const mode = ref('range');
let time=ref('')
let page=ref(1)
let status=ref('nomore')
let historyList=ref<Array<any>>([])
let type=ref(null)
onLoad((data:any) => {
type.value=data.type
if(data.type==0){
uni.setNavigationBarTitle({
title:'交易明细'
})
}else{
uni.setNavigationBarTitle({
title:'交易记录'
})
}
getData()
});
onShow(() => {
});
const getData=()=>{
status.value='Loadmore'
page.value=1
historyList.value=[]
getList()
}
const getList=()=>{
if(status.value=='loading' || status.value=='loadmore' ){
return
}
status.value='loading'
// vpOrderService.GetUserOrderList(String(currentIndex.value)==='3'?time.value:(String(currentIndex.value)==='0'?'':String(currentIndex.value)),page.value).then(res=>{
// if(res.code==0){
// historyList.value=[...historyList.value,...res.data.list]
// status.value=res.data.list.length==10?'loadmore':'nomore'
// page.value++
// }else{
// Service.Msg(res.msg)
// }
// })
}
const changetab=(e:number)=>{
if(e==3){
showDate.value=true
return
}
currentIndex.value=e
getData()
}
const confirmDate = (e) => {
currentIndex.value=3
time.value=e[0]+'_'+e[e.length-1]
getData()
showDate.value=false
};
</script>
<style lang="scss">
.active{
background-color: #F3F4F6;
color: #4B5563;
}
.actived{
background-color: #FF6B35;
color: #fff;
}
.tag{
display: flex;
align-items: center;
justify-content: center;
width: fit-content;
font-size: 28rpx;
}
</style>