抽奖修改
This commit is contained in:
@@ -12,16 +12,17 @@
|
||||
>{{item.label}}</view>
|
||||
</view>
|
||||
<view class="item" v-for="(item,index) in list" :key="index">
|
||||
<view class="color-666 u-font-24">中奖时间 2024-09-11 10:20:11</view>
|
||||
<view class="color-666 u-font-24">{{tabIndex==1?'中奖时间':'兑换时间'}} {{item.createTime}}</view>
|
||||
<view class="u-m-t-24 u-flex u-row-between">
|
||||
<view class="u-flex-1 u-flex u-col-top">
|
||||
<u-image width="128rpx" height="128rpx" src="/static/red-pack.png"></u-image>
|
||||
<!-- <u-image width="128rpx" height="128rpx" src="/static/red-pack.png"></u-image> -->
|
||||
<view class="u-m-l-16">
|
||||
<view>大额红包</view>
|
||||
<view class="color-999 u-font-24 u-m-t-16">×1</view>
|
||||
<view v-if="tabIndex == 1">{{item.name}}</view>
|
||||
<view v-else>{{item.prizeName}}</view>
|
||||
<view v-if="tabIndex == 1" class="color-999 u-font-24 u-m-t-16">×{{item.number}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="" v-if="tabIndex==1&&item.targetId&&item.type==3">
|
||||
<view class="btn-circle duihuan" @click="toDuiHuan(item)">立即兑换</view>
|
||||
<!-- <view class="btn-circle duihuan finish">已完成</view> -->
|
||||
</view>
|
||||
@@ -47,8 +48,8 @@
|
||||
tab: [{label: '抽奖记录', type: 1},{label: '兑换记录', type: 2}],
|
||||
tabIndex: 1,
|
||||
query: {
|
||||
page: 10,
|
||||
limit: 1,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
source: 1,
|
||||
},
|
||||
total: 0,
|
||||
@@ -59,10 +60,11 @@
|
||||
},
|
||||
onLoad(options) {
|
||||
if ( options.source ) {
|
||||
this.query.source = options.source
|
||||
this.query.source = 2
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.list = [];
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
@@ -86,18 +88,20 @@
|
||||
this.$Request.getT(url, this.query).then(res => {
|
||||
if (res.code == 0 ) {
|
||||
if ( this.tabIndex == 1) {
|
||||
this.list = res.data.records
|
||||
this.list = [...this.list,...res.data.records]
|
||||
this.total = res.data.total
|
||||
} else {
|
||||
this.list = res.page.list
|
||||
this.list = [...this.list,...res.page.list]
|
||||
this.total = res.page.totalCount
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
onReachBottom: function () {
|
||||
if (this.page * this.limit < this.total) {
|
||||
this.page = this.page + 1;
|
||||
console.log(this.query.page)
|
||||
console.log(this.query.limit)
|
||||
if (this.query.page * this.query.limit < this.total) {
|
||||
this.query.page = this.query.page + 1;
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user