<template>
|
|
<view class="u-page">
|
|
<view class="u-demo-block-2" >
|
<view>
|
<u-cell-group>
|
<u-cell
|
@click="showCalendar(index)"
|
title="日期筛选"
|
:label="calendarLabel"
|
isLink
|
>
|
<image
|
slot="icon"
|
src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/d8/d8398aa04a2040809285a9319cd9acc2calendar.png"
|
mode="widthFix"
|
class="image-icon"
|
></image>
|
</u-cell>
|
</u-cell-group>
|
|
<u-calendar
|
:show="calendarShow"
|
minDate="2024-07-01"
|
:maxDate="maxDate"
|
allowSameDay="true"
|
:monthNum="12"
|
mode="range"
|
:startText="startText"
|
:endText="endText"
|
:defaultDate="[query.startDate,query.endDate]"
|
@confirm="confirm"
|
@close="close"
|
>
|
</u-calendar>
|
</view>
|
|
<u-cell-group>
|
<u-cell
|
v-for="(item,index) in list " :key="index"
|
>
|
<!-- 收入 -->
|
<!-- https://hmy-flower.oss-cn-shanghai.aliyuncs.com/56/56abe8c4217a4f41a87cee6a82a36913billincome.png -->
|
<!-- 提现发起 -->
|
<!-- https://hmy-flower.oss-cn-shanghai.aliyuncs.com/47/4778ee2740904450a9d420305e9c940awithdrawstart.png -->
|
<!-- 提现成功 -->
|
<!-- https://hmy-flower.oss-cn-shanghai.aliyuncs.com/47/477032a3a4a3480ea71f0aad040f9047withdrawsucess.png -->
|
<!-- 提现失败 -->
|
<!-- https://hmy-flower.oss-cn-shanghai.aliyuncs.com/37/3721dfee31684221b3476e4182517699withdrawfail.png -->
|
|
<view slot="icon">
|
<image v-if="item.type=='settlement' " src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/56/56abe8c4217a4f41a87cee6a82a36913billincome.png" class="image-icon"></image>
|
<image v-else-if="item.type=='withdraw' && item.withdrawType=='start' " src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/47/4778ee2740904450a9d420305e9c940awithdrawstart.png" class="image-icon"></image>
|
<image v-else-if="item.type=='withdraw' && item.withdrawType=='success' " src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/47/477032a3a4a3480ea71f0aad040f9047withdrawsucess.png" class="image-icon"></image>
|
<image v-else-if="item.type=='withdraw' && item.withdrawType=='fail' " src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/37/3721dfee31684221b3476e4182517699withdrawfail.png" class="image-icon"></image>
|
<image v-else src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/56/56abe8c4217a4f41a87cee6a82a36913billincome.png" class="image-icon"></image>
|
</view>
|
<view slot="title" class="f10">{{ item.typeName }}<text v-if="item.withdrawType"> ({{item.withdrawTypeName}}) </text> </view>
|
<view slot="label" class="f10" >{{ getYyyyMmDdHh24Mi(item.createTime) }}</view>
|
<view slot="value" style="text-align: right;" class="f10">
|
<view>
|
<text v-if="item.method==='reduce' && item.withdrawType !='success' " class="f-c-y">-{{ item.changeAmount }}</text>
|
<text v-else-if="item.method==='add' " class="f-c-r">+{{ item.changeAmount }}</text>
|
<text v-else></text>
|
</view>
|
<view>余额:{{ item.balance }}</view>
|
</view>
|
</u-cell>
|
</u-cell-group>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import dayjs from 'dayjs'
|
export default {
|
data() {
|
return {
|
calendarShow:false,
|
calendarLabel:'',
|
startText:"",
|
endText:"",
|
minDate: '',
|
maxDate: '',
|
query:{
|
startDate:"",
|
endDate:""
|
},
|
};
|
},
|
|
onLoad(options) {
|
this.getDefaultDate()
|
this.getPageList()
|
},
|
onShow() {
|
|
},
|
onReachBottom() {
|
this.getMore()
|
},
|
async onPullDownRefresh() {
|
this.page.current = 1
|
await this.getPageList()
|
uni.stopPullDownRefresh()
|
},
|
methods: {
|
getDefaultDate(){
|
// 获取当天的开始日期和结束日期
|
let startDate=dayjs().format('YYYY-MM-DD')
|
let endDate=dayjs().format('YYYY-MM-DD')
|
this.query.startDate=startDate
|
this.query.endDate=endDate
|
this.calendarLabel=startDate+"~"+endDate
|
|
this.minDate = dayjs().subtract(2, 'month').format('YYYY-MM-DD')
|
this.maxDate=dayjs().format('YYYY-MM-DD')
|
},
|
click(name) {
|
|
},
|
showCalendar(){
|
this.calendarShow=true
|
},
|
confirm(e){
|
console.log("日历的值")
|
console.log(e)
|
this.query.startDate=e[0]
|
this.query.endDate=e[e.length-1]
|
this.calendarLabel=e[0]+"~"+e[e.length-1]
|
this.calendarShow=false
|
this.getPageList()
|
},
|
close(){
|
this.calendarShow=false
|
},
|
|
async getPageList(){
|
this.page.size=20
|
this.listApi = '/v2/wallet-bill-record/pageByDesc'
|
let ref=await this.getList()
|
console.log(ref)
|
},
|
|
getYyyyMmDdHh24Mi(date){
|
if(date){
|
return dayjs(date).format('YYYY-MM-DD HH:mm')
|
}
|
return ""
|
}
|
|
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.u-page{
|
font-size: 14px;
|
.f-c-y{
|
color: #FEA850;
|
}
|
.f-c-r{
|
color: red;
|
}
|
|
.f10{
|
font-size: 14px;
|
}
|
.image-icon{
|
width:50rpx;
|
height: 50rpx;
|
}
|
.u-button--plain.data-v-3bf2dba7 {
|
background-color: #00BCD4;
|
}
|
.u-button--plain.u-button--primary.data-v-3bf2dba7 {
|
color: #FFFFFF;
|
}
|
.u-button--primary.data-v-3bf2dba7 {
|
color: #fff;
|
border-color: #00BCD4;
|
border-width: 1px;
|
border-style: solid;
|
border-radius: 10rpx;
|
width:200rpx;
|
}
|
.u-demo-block{
|
padding: 10rpx;
|
background-color: #FFFFFF;
|
border-radius: 50rpx;
|
background-color: #00AF68;
|
margin: 20rpx;
|
.tixian{
|
margin-top: 30rpx;
|
margin-bottom: 30rpx;
|
}
|
}
|
.u-demo-block-2{
|
margin: 10rpx;
|
// padding: 10rpx;
|
background-color: #FFFFFF;
|
border-radius: 10rpx;
|
}
|
.title{
|
text-align: center;
|
font-size: 30rpx;
|
color: #909399;
|
margin: 10rpx;
|
}
|
.grid-text-white{
|
color: white;
|
}
|
.grid-text {
|
font-size: 14px;
|
color: #909399;
|
padding: 10rpx 0 20rpx 0rpx;
|
/* #ifndef APP-PLUS */
|
box-sizing: border-box;
|
/* #endif */
|
}
|
.statis_val{
|
font-size: 16px;
|
color: black;
|
// font-weight: bold;
|
}
|
|
.margin-10{
|
margin:10rpx;
|
}
|
}
|
</style>
|