xinelu-applet-ui/pagesB/exchangerecords/exchangerecords.vue

147 lines
2.8 KiB
Vue
Raw Normal View History

2023-09-22 15:29:53 +08:00
<template>
<view class="app">
2023-10-16 11:21:27 +08:00
<view class="" v-if="list&&list.length>0">
<view class="content" v-for="item in list">
<view class="time">
{{item.exchangeDate?item.exchangeDate:''}}
<span>
{{item.score?item.score:0}} 积分
</span>
</view>
<image :src="item.prizeBase64" mode=""></image>
<view class="servename">
{{item.prizeName?item.prizeName:''}}
</view>
<view class="servetime" v-if='item.useDate'>
服务时间{{item.useDate}}
</view>
2023-09-26 17:59:59 +08:00
</view>
</view>
2023-10-16 11:21:27 +08:00
<u-empty v-else mode="list" icon-size='220' text='暂无兑换记录'></u-empty>
2023-09-22 15:29:53 +08:00
</view>
</template>
<script>
2023-10-16 11:21:27 +08:00
import {
prizeExchangelist
} from '@/api/pagesB/exchangerecords/index.js'
2023-09-22 15:29:53 +08:00
export default {
data() {
return {
2023-10-16 11:21:27 +08:00
query: {
identity: uni.getStorageSync('userinfo').cardNo,
pageNum: 1,
pageSize: 10,
},
list: [],
total: 0,
2023-09-22 15:29:53 +08:00
};
2023-10-16 11:21:27 +08:00
},
onLoad() {
this.info()
},
methods: {
info() {
prizeExchangelist(this.query).then(res => {
this.list = res.rows
this.total = res.total
})
},
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.query.pageNum++
prizeExchangelist(this.query).then(res => {
if (res.rows) {
res.rows.forEach(e => {
this.list.push(e)
})
}
})
}
},
onPullDownRefresh() { //下拉刷新
this.query.pageNum = 1;
this.info();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
2023-09-22 15:29:53 +08:00
}
</script>
<style lang="scss">
2023-09-26 17:59:59 +08:00
.app {
width: 100%;
text-align: justify;
padding: 25rpx 0 30rpx 0;
2023-10-16 11:21:27 +08:00
::v-deep .u-empty{
margin-top: 25vh !important;
}
2023-09-26 17:59:59 +08:00
.content {
width: 90%;
height: 321rpx;
background: #FFFFFF;
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
border-radius: 5rpx;
margin: 20rpx auto;
position: relative;
.servetime {
2023-10-16 11:21:27 +08:00
font-size: 26rpx;
2023-09-26 17:59:59 +08:00
font-weight: 400;
color: #959595;
line-height: 38rpx;
position: absolute;
2023-09-27 13:50:42 +08:00
bottom: 23%;
2023-09-26 17:59:59 +08:00
left: 35%;
2023-10-16 11:21:27 +08:00
text-align: justify;
2023-09-26 17:59:59 +08:00
}
.servename {
font-size: 32rpx;
font-weight: 500;
color: #333333;
line-height: 38rpx;
position: absolute;
top: 38%;
left: 35%;
2023-09-27 13:50:42 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2023-09-26 17:59:59 +08:00
}
2023-09-22 15:29:53 +08:00
2023-10-16 11:21:27 +08:00
image {
2023-09-26 17:59:59 +08:00
position: absolute;
left: 3%;
top: 28%;
2023-10-16 11:21:27 +08:00
width: 180rpx;
height: 180rpx;
2023-09-26 17:59:59 +08:00
}
.time {
2023-10-16 11:21:27 +08:00
text-align: justify;
2023-09-26 17:59:59 +08:00
padding: 25rpx 0 0 20rpx;
font-size: 28rpx;
font-weight: 400;
color: #000000;
line-height: 38rpx;
position: relative;
span {
2023-09-27 13:50:42 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2023-09-26 17:59:59 +08:00
font-size: 28rpx;
position: absolute;
font-weight: 500;
color: #26A888;
line-height: 38rpx;
right: 3%;
}
}
}
}
2023-10-16 11:21:27 +08:00
</style>