公司小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
3.1 KiB

3 years ago
<!--作用与钱包界面显示提现手续费收入等一行的显示-->
<template>
<view class="dwrapper">
<view class="title_box">
<image class="icon" :src="getTargetImageOfThisType()"/>
<text class="title">{{this.getTargetTitleOfThisType()}}</text>
<text class="time">{{this.getTimeOfString()}}</text>
</view>
<text v-if="cashNumber >= 0" class="money_earn">{{this.getMoneyFormatted()}}</text>
<text v-else class="money_used">{{this.getMoneyFormatted()}}</text>
</view>
</template>
<script>
import utils from "@/common/utils.js"
export default {
name:"WalletListItem",
props:{
/**
* 类型0->提现1->提现手续费2->收入3->平台维护费
*/
dType : {
type:Number,
default:0,
},
/**
* 产生当前数据的时间如果不传默认为-1会显示无具体记录
*/
time : {
type:Number,
default:-1,
},
/**
* 产生的具体金额可能为负数表示扣除
*/
cashNumber : {
type:Number,
default:0,
},
},
data() {
return {
};
},
methods:{
/**
* 根据当前类型返回使用的图片
*/
getTargetImageOfThisType(){
if(this.dType == 0 || this.dType == 1){
return "../../static/images/wallet/zhichu.png";
}
if(this.dType == 2){
return "../../static/images/wallet/shouru.png";
}
return "../../static/images/wallet/pingtai.png";
},
getTargetTitleOfThisType(){
switch(this.dType){
case 0:
return "提现";
case 1:
return "提现手续费";
case 2:
return "收入";
case 3:
return "平台维护费";
default :
return "未知";
}
},
getTimeOfString(){
var nt = this.time;
if(this.time == -1){
nt = Date.parse(new Date()) / 1000;
}
return utils.formatTime(nt);
},
///格式化金额
getMoneyFormatted(){
var st = utils.formatMoney(this.cashNumber);
st = "¥" + st;
return st;
}
},
}
</script>
<style lang="scss" scoped>
.dwrapper{
width: 702rpx;
height: 110rpx;
//background-color: #0081FF;
border-radius: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.title_box{
width: 300rpx;
height: 100%;
//background-color: #9000FF;
position: relative;
margin-left: 20rpx;
}
.icon{
width: 26rpx;
height: 26rpx;
position: absolute;
left: 0;
top: 37rpx;
}
.title{
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
opacity: 1;
position: absolute;
left: 38rpx;
top: 28rpx;
}
.time{
height: 30rpx;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
opacity: 1;
position: absolute;
left: 38rpx;
top: 70rpx;
}
///扣费
.money_used{
height: 40rpx;
font-size: 28rpx;
font-weight: bold;
color: #333333;
opacity: 1;
text-align: right;
padding-right: 20rpx;
}
///挣钱
.money_earn{
height: 40rpx;
font-size: 28rpx;
font-weight: bold;
color: #D49B4B;
opacity: 1;
text-align: right;
padding-right: 20rpx;
}
</style>