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

131 lines
2.3 KiB
Vue
Raw Normal View History

2023-09-26 17:59:59 +08:00
<template>
<view class="app">
2023-10-16 10:08:17 +08:00
<view class="content" v-for="item in list">
<image :src="item.attachment" mode=""></image>
2023-10-16 09:25:38 +08:00
<view class="servename">
2023-10-16 10:08:17 +08:00
{{item.prizeName}}
2023-10-16 09:25:38 +08:00
</view>
<view class="PointsRecord">
2023-10-16 10:08:17 +08:00
{{item.score}}
2023-10-16 09:25:38 +08:00
</view>
<view class="button" @tap="goexchange">
兑换
</view>
2023-09-27 13:50:42 +08:00
</view>
</view>
2023-09-26 17:59:59 +08:00
</template>
<script>
2023-10-16 10:08:17 +08:00
import {
prizelist
} from '@/api/pagesB/PointsMall/index.js'
2023-09-26 17:59:59 +08:00
export default {
data() {
2023-10-16 10:08:17 +08:00
return {
query: {
identity: '372325195905293621',
pageNum: 1,
pageSize: 10,
},
list: [],
total: 0,
};
2023-09-26 17:59:59 +08:00
},
methods: {
goexchange() {
uni.navigateTo({
url: '/pagesB/exchangerecords/exchangerecords'
});
},
2023-10-16 10:08:17 +08:00
info() {
prizelist(this.query, '2').then(res => {
this.list = res.rows
this.total = res.total
})
},
},
onLoad() {
this.info();
},
onReachBottom() { //下滑加载
if (this.list.length >= this.total) {} else {
this.query.pageNum++
prizelist(this.query, '1').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-26 17:59:59 +08:00
},
}
</script>
<style lang="scss">
.app {
background-color: #F7F5F5;
2023-10-16 10:08:17 +08:00
padding-top: 10rpx;
2023-09-26 17:59:59 +08:00
height: 100vh;
display: flex;
width: 100%;
flex-wrap: wrap;
2023-10-16 10:08:17 +08:00
justify-content: space-evenly;
2023-09-26 17:59:59 +08:00
.content {
height: 514rpx;
background: #fff;
2023-10-16 10:08:17 +08:00
width: 48%;
2023-09-26 17:59:59 +08:00
position: relative;
border-radius: 5rpx;
2023-10-16 10:08:17 +08:00
margin: 0 0 20rpx 0;
2023-09-26 17:59:59 +08:00
.button {
width: 100rpx;
height: 44rpx;
line-height: 44rpx;
position: absolute;
text-align: center;
font-size: 22rpx;
font-weight: 400;
color: #fff;
right: 3%;
bottom: 5%;
background: #26A888;
border-radius: 5rpx;
}
.PointsRecord {
2023-10-16 10:08:17 +08:00
padding-top: 20rpx;
font-size: 22rpx;
2023-09-26 17:59:59 +08:00
font-weight: 400;
color: #26A888;
padding-left: 3%;
}
.servename {
2023-09-27 13:50:42 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2023-10-16 10:08:17 +08:00
font-size: 28rpx;
2023-09-26 17:59:59 +08:00
font-weight: 400;
color: #000000;
padding-left: 3%;
}
2023-10-16 10:08:17 +08:00
image {
width: 100%;
height: 355rpx;
border-radius: 5rpx;
2023-09-26 17:59:59 +08:00
}
}
}
</style>