118 lines
2.4 KiB
Vue
118 lines
2.4 KiB
Vue
<template>
|
|
<view class="logs-view">
|
|
<view class="btn-box">
|
|
<button type="default" plain size="mini">抽奖日期</button>
|
|
<button type="default" plain size="mini">抽奖结果</button>
|
|
</view>
|
|
|
|
<view class="list-box">
|
|
<view class="item flex jc-between ai-center" v-for="item in list">
|
|
<view class="flex">
|
|
<text class="date">{{item.drawTime}}</text>
|
|
<text class="goods one-t">{{item.prizeName}}</text>
|
|
</view>
|
|
|
|
<image class="btn flex-0" :src="webUrl+'/20220611142551342281.png'" @click="goReceive(item.id)"
|
|
v-if="item.status==1 && item.isHit==1"></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
getLotteryRecordsMy
|
|
} from "@/api/luck.js";
|
|
export default {
|
|
data() {
|
|
return {
|
|
webUrl: this.$VUE_APP_RESOURCES_URL,
|
|
lotteryId: null,
|
|
list: [],
|
|
page: 1
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
this.lotteryId = option.id;
|
|
},
|
|
onShow() {
|
|
this.list = [];
|
|
this.fetchList();
|
|
},
|
|
onReachBottom() {
|
|
this.page++;
|
|
this.fetchList();
|
|
},
|
|
methods: {
|
|
fetchList() {
|
|
getLotteryRecordsMy(this.lotteryId, this.page).then(res => {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
this.list.push(res.data.records[i])
|
|
}
|
|
})
|
|
},
|
|
|
|
goReceive(id) {
|
|
uni.navigateTo({
|
|
url: "receive?id=" + id
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.logs-view {
|
|
position: relative;
|
|
height: 100vh;
|
|
background: linear-gradient(180deg, #FFD884 0%, #FF5307 100%);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.btn-box {
|
|
margin-top: 54rpx;
|
|
|
|
button {
|
|
outline: none;
|
|
margin: 0 88rpx;
|
|
border: none;
|
|
border-radius: 30rpx;
|
|
background: linear-gradient(180deg, #ffcd1e 0%, #ff8a18 100%);
|
|
color: #fff;
|
|
font-size: 28rpx;
|
|
}
|
|
}
|
|
|
|
.list-box {
|
|
height: 75vh;
|
|
margin-top: 20rpx;
|
|
padding: 32rpx;
|
|
overflow-y: auto;
|
|
|
|
.item {
|
|
height: 60rpx;
|
|
margin-bottom: 16rpx;
|
|
padding: 0 46rpx;
|
|
border-radius: 30rpx;
|
|
background: rgba(255, 255, 255, .4);
|
|
font-size: 24rpx;
|
|
|
|
.date {
|
|
display: inline-block;
|
|
width: 350rpx;
|
|
color: #333;
|
|
}
|
|
|
|
.goods {
|
|
width: 190rpx;
|
|
color: #FF1200;
|
|
}
|
|
|
|
.btn {
|
|
width: 80rpx;
|
|
height: 38rpx;
|
|
}
|
|
}
|
|
}
|
|
</style>
|