公司小程序
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.

137 lines
2.6 KiB

3 years ago
<!--作用与钱包界面显示提现手续费收入等一行的显示-->
<template>
<view class="dwrapper">
<view class="title_box">
<image class="icon" :src="getTargetImageOfThisType()"/>
<text class="title">{{getTargetTitleOfThisType()}}</text>
<text class="time">{{getTimeOfString()}}</text>
3 years ago
</view>
<text v-if="record.scorenum >= 0" class="money_earn">{{this.getMoneyFormatted()}}</text>
3 years ago
<text v-else class="money_used">{{this.getMoneyFormatted()}}</text>
</view>
</template>
<script>
import utils from "@/common/utils.js"
export default {
name:"WalletListItem",
props:{
record : {
type:Object,
default:{}
3 years ago
},
index : {
3 years ago
type:Number,
default:0
}
3 years ago
},
data() {
return {
};
},
methods:{
/**
* 根据当前类型返回使用的图片
*/
getTargetImageOfThisType(){
var dType = this.record.amounttype;
if(dType == 1 || dType == 2){
3 years ago
return "../../static/images/wallet/zhichu.png";
}
if(dType == 3){
3 years ago
return "../../static/images/wallet/shouru.png";
}
return "../../static/images/wallet/pingtai.png";
},
getTargetTitleOfThisType(){
return this.record.recorddesc;
3 years ago
},
getTimeOfString(){
var nt = this.record.inserttime;
if(nt <= 0){
3 years ago
nt = Date.parse(new Date()) / 1000;
}
return utils.formatTime(nt);
},
///格式化金额
getMoneyFormatted(){
var st = utils.formatMoney(this.record.scorenum / 100);
3 years ago
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>