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.
jwl-applet/src/pages/me/myGift.vue

97 lines
2.6 KiB

1 year ago
<template>
<view class="p10lr p20tb">
1 year ago
<u-list @scrolltolower="loadmore">
<u-list-item v-for="(item, index) in list" :key="index" class="item">
<view class="relative">
<img src="/static/image/mine/giftitem.png" style="width: 100%;" mode="widthFix" alt="" />
<view class="ab_full df ai-c jcc">{{item.awards}}</view>
1 year ago
</view>
1 year ago
<view class="df ai-c jcsb p20tb p10lr">
<view class="item-label">
<view>活动名称{{ item.activityName }}</view>
<view>参与时间{{ item.createTime }}</view>
<view>有效期至{{ item.endTime }}</view>
</view>
<view class="ml20" style="width: 120rpx;">
1 year ago
<view v-if="item.status == 0" class="btn" @tap="handleHelp(item)">助力</view>
<view v-else-if="item.status == 1" class="btn" @tap="handleWriteoff(item)">核销</view>
<img v-else-if="item.status == 2" src="/static/image/mine/writeoff.png" style="width: 120rpx;height: 120rpx;" />
1 year ago
<img v-else src="/static/image/mine/outtime.png" style="width: 120rpx;height: 120rpx;" />
1 year ago
</view>
1 year ago
</view>
1 year ago
</u-list-item>
</u-list>
1 year ago
</view>
</template>
<script>
1 year ago
import useUserStore from '@/jtools/store/user'
import { getLuckyRecord } from '@/jtools/api/activity'
1 year ago
export default {
data() {
return {
1 year ago
pageNum: 1,
1 year ago
list: []
}
},
onShow() {
1 year ago
this.pageNum = 1
this.list = []
1 year ago
this.handleSearch()
},
methods: {
handleSearch() {
1 year ago
getLuckyRecord({
phone: useUserStore().userInfo.phone,
pageSize: 10,
pageNum: this.pageNum
}).then(resp => {
if(resp.code == 200) {
if(resp.rows && resp.rows.length) {
this.list = [...this.list, ...resp.rows]
} else {
this.pageNum = this.pageNum > 1 ? this.pageNum-1 : 1
}
}
})
},
loadmore() {
this.handleSearch(this.pageNum++)
1 year ago
},
handleWriteoff(item) {
uni.navigateTo({
1 year ago
url: `/pages/me/qrCode?id=${item.id}`
1 year ago
})
1 year ago
},
1 year ago
handleHelp(item){
uni.navigateTo({
url: `/pages/me/help?id=${item.id}`
})
}
1 year ago
}
}
</script>
<style lang="scss" scoped>
.item {
margin-bottom: 30rpx;
border-radius: 36rpx;
background-color: #fff;
.item-label {
font-size: 28rpx;
color: #666;
line-height: 48rpx;
}
.btn {
width: 120rpx;
height: 68rpx;
text-align: center;
line-height: 68rpx;
border-radius: 34rpx;
background-color: #BE1200;
color: #fff;
font-size: 28rpx;
}
}
</style>