奖品记录

This commit is contained in:
duan 2025-01-15 11:32:52 +08:00
parent 9e30dbbc83
commit 24d076575b
6 changed files with 208 additions and 7 deletions

View File

@ -61,3 +61,17 @@ export const drawCount = (data) => {
data
})
}
// 获取记录
export const selectDiscSpinningRecord = (data) => {
return http.request({
url: '/discSpinningRecord/selectDiscSpinningRecord',
data
})
}
// 兑换记录
export const userPrizeExchange = (data) => {
return http.request({
url: '/userPrizeExchange/page',
data
})
}

View File

@ -195,6 +195,13 @@
"style": {
"navigationBarTitleText": ""
}
},
{
"path" : "pages/index/prizeDraw/LotteryRecords",
"style" :
{
"navigationBarTitleText" : "我的奖励"
}
}
],
"globalStyle": {

View File

@ -0,0 +1,180 @@
<template>
<view class="gift-bg"></view>
<view class="list">
<view class="tab">
<view class="tab_item" :class="{ active: item.type == datas.tabIndex }" @click="tabClickczgw(item)"
v-for="(item, index) in datas.tab" :key="index">{{ item.label }}</view>
</view>
<view class="item" v-for="(item, index) in datas.list" :key="index">
<view class="color-666 u-font-24">中奖时间 {{item.drawDay}}</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/index/redPack.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>
</view>
<view class="">
<!-- <view class="btn-circle duihuan" @click="toDuiHuan(item)">立即兑换</view> -->
</view>
</view>
</view>
<view class="empty" v-if="!datas.list.length">
<u-empty text="暂无记录" src="/static/icon-empty.svg"></u-empty>
</view>
</view>
</template>
<script setup>
import {
reactive
} from 'vue';
import {
onReachBottom,
onShow
} from '@dcloudio/uni-app'
import {
selectDiscSpinningRecord,
userPrizeExchange
} from '@/api/index/index.js'
let datas = reactive({
list: [],
tab: [{
label: '抽奖记录',
type: 1
},
{
label: '兑换记录',
type: 2
}
],
tabIndex: 1,
page: 1
})
onShow(() => {
getList();
})
onReachBottom(() => {
++datas.page
getList();
})
async function getList() {
let res = '';
if (datas.tabIndex == 1) {
res = await selectDiscSpinningRecord({
page: datas.page,
limit: 10,
source: 1
})
} else {
res = await userPrizeExchange({
page: datas.page,
limit: 10,
source: 1
})
}
if (datas.tabIndex == 1) {
if (datas.page == 1) {
datas.list = res.records;
} else {
if (res.records.length) {
datas.list.push(...datas.list, res.records)
}
}
} else {
if (datas.page == 1) {
datas.list = res.page.list;
} else {
if (res.records.length) {
datas.list.push(...datas.list, res.records)
}
}
// datas.total = res.page.totalCount;
}
}
function tabClickczgw(item) {
datas.list = [];
datas.tabIndex = item.type;
datas.page = 1
getList();
}
//
function toDuiHuan(item) {
uni.navigateTo({
url: `/me/gift/duihuan?source=${this.query.source}&id=${item.id}`
});
}
</script>
<style lang="scss" scoped>
.gift-bg {
position: relative;
width: 100%;
height: 524rpx;
background: url('@/static/index/giftbg.png') no-repeat center center/cover;
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
}
.duihuan {
background: linear-gradient(87deg, #ed8087 0%, #eca2aa 100%);
font-size: 24rpx;
color: #fff;
padding: 8rpx 16rpx;
text-align: center;
&.finish {
background: #e5e5e5;
color: #999;
}
}
.empty {
margin-top: 140rpx;
}
.list {
margin: 0 20rpx;
position: relative;
z-index: 2;
margin-top: -148rpx;
border-radius: 18rpx 18rpx 18rpx 18rpx;
overflow: hidden;
background-color: #fff;
.tab {
display: flex;
.tab_item {
height: 80rpx;
line-height: 80rpx;
width: 50%;
text-align: center;
font-size: 32rpx;
color: #333;
}
.active {
background-color: #eca2aa;
color: #fff;
}
}
.item {
padding: 32rpx 24rpx;
border-bottom: 1rpx solid #e5e5e5;
}
}
</style>

View File

@ -17,7 +17,7 @@
<view class="t-fh-fs t-flex-row-sb">
<view class="t-flex-row" @tap='goUrl("/pages/me/withdraw/index")' hover-class="t-click-class">红包
&nbsp;{{totalMoney}}</view>
<button open-type="share" @tap='goUrl("/pages/task/prizeList?source=2")'
<button open-type="share" @tap='goUrl("/pages/index/prizeDraw/LotteryRecords")'
class="t-share t-flex-row t-plain-btn" hover-class="t-click-class">我的奖品</button>
</view>
<view class="t-line"></view>
@ -38,11 +38,11 @@
<view class="t-xxcy-ts t-flex-row">再努力努力肯定就会中哦~</view>
</view> -->
<view class="t-tk-zj t-flex-col-s">
<image class="t-tk-zj-tip" src="./luck/wenzi.png"></image>
<image class="t-tk-zj-tip" src="./luck/wenzi.png" ></image>
<view class="t-tk-zj-desc t-flex-col">
<image class="t-zj-jp" :src="selectData.img"></image>
<image class="t-zj-jp" :src="selectData.img" mode="aspectFit"></image>
<view class="t-zj-jp-desc">
{{selectData.name}}
{{selectData.name}}&nbsp;&nbsp;{{selectData.number}}
</view>
</view>
</view>
@ -98,7 +98,7 @@
})
},
onDone(index) {
this.selectData = this.list[index]
this.selectData.img = this.list[index].img
this.isShowAwd = true
},
@ -111,6 +111,7 @@
this.list.forEach((ele, index) => {
if (ele.id == res.discSpinningId) {
indexs = index
this.selectData = res
}
})
//
@ -122,7 +123,6 @@
const res = await drawCount({
source: 1
});
// this.luckDrawTimes = 10;
this.luckDrawTimes = res.count || 0;
this.freeNumDay = res.sum || 0;
},
@ -524,7 +524,7 @@
}
.t-zj-jp-desc {
font-size: 24rpx;
font-size: 36rpx;
color: #D93637;
text-align: center;
width: 420rpx;

BIN
static/index/giftbg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
static/index/redPack.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB