提交
This commit is contained in:
parent
7979cfd80c
commit
4f79f70a8f
|
|
@ -32,7 +32,34 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<rule-pop ref="rulePop"></rule-pop>
|
||||
|
||||
<!-- 中奖记录弹窗 -->
|
||||
<uni-popup ref="recordsPop" type="center" mask-background-color="rgba(0,0,0,0.8)">
|
||||
<view class="records-pop">
|
||||
<view class="records-pop-title">中奖记录</view>
|
||||
<scroll-view scroll-y class="records-pop-content">
|
||||
<view v-if="prizeRecords.length > 0" class="records-list">
|
||||
<view v-for="(item, index) in prizeRecords" :key="index" class="record-card">
|
||||
<view class="flex row align-center"
|
||||
style="width: 100%; height: 100%; justify-content: space-between;">
|
||||
<view class="flex column" style="margin-left: 24rpx;">
|
||||
<text style="font-size: 20rpx; color: #999999;">{{ item.title }}</text>
|
||||
<text style="font-size: 20rpx; color: #999999; margin-top: 8rpx;">{{ item.time
|
||||
}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-tip">暂无中奖记录</view>
|
||||
</scroll-view>
|
||||
<view class="close-btn" @click="$refs.recordsPop.close()">
|
||||
<image :src="$img1('common/close.png')" style="width: 48rpx;height: 48rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</page-container>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -67,7 +94,8 @@ export default {
|
|||
useMoney: true,
|
||||
useIntegral: true,
|
||||
useMoney2: true,
|
||||
selectPrizes: null
|
||||
selectPrizes: null,
|
||||
prizeRecords: [] // 中奖记录列表
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
|
@ -231,10 +259,7 @@ export default {
|
|||
});
|
||||
return;
|
||||
}
|
||||
uni.showToast({
|
||||
title: '规则说明功能待实现',
|
||||
icon: 'none'
|
||||
});
|
||||
this.$refs.rulePop.getRule(22, '规则说明')
|
||||
},
|
||||
|
||||
// 显示中奖记录
|
||||
|
|
@ -246,10 +271,37 @@ export default {
|
|||
});
|
||||
return;
|
||||
}
|
||||
uni.showToast({
|
||||
title: '中奖记录功能待实现',
|
||||
icon: 'none'
|
||||
});
|
||||
// 加载中奖记录
|
||||
this.loadPrizeRecords();
|
||||
// 打开弹窗
|
||||
this.$refs.recordsPop.open();
|
||||
},
|
||||
|
||||
// 加载中奖记录
|
||||
async loadPrizeRecords() {
|
||||
try {
|
||||
const { status, data, msg } = await this.$request.post('infinite_prizerecords', {
|
||||
goods_id: this.goods_id
|
||||
});
|
||||
|
||||
if (status !== 1) {
|
||||
this.$c.msg(msg || '获取中奖记录失败');
|
||||
return;
|
||||
}
|
||||
|
||||
if (data && data.data && data.data.length > 0) {
|
||||
// 格式化中奖记录数据
|
||||
this.prizeRecords = data.data.map(item => ({
|
||||
title: item.goodslist_title || '未知奖品',
|
||||
time: item.addtime || ''
|
||||
}));
|
||||
} else {
|
||||
this.prizeRecords = [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载中奖记录失败', error);
|
||||
this.$c.msg('获取中奖记录失败');
|
||||
}
|
||||
},
|
||||
|
||||
async confirmSubmit([type, num, flag]) {
|
||||
|
|
@ -412,7 +464,6 @@ export default {
|
|||
width: 136.11rpx;
|
||||
height: 53.47rpx;
|
||||
font-size: 28rpx;
|
||||
|
||||
border-radius: 35rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -463,4 +514,80 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 中奖记录弹窗样式
|
||||
.records-pop {
|
||||
width: 600rpx;
|
||||
height: 750rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
.records-pop-title {
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.records-pop-content {
|
||||
flex: 1;
|
||||
padding: 20rpx;
|
||||
|
||||
.records-list {
|
||||
width: 94%;
|
||||
.record-item {
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
|
||||
.prize-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.prize-title {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.prize-time {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: -80rpx;
|
||||
transform: translateX(-50%);
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.record-card {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
background-color: #F8F8F8;
|
||||
margin: 0 auto 0rpx;
|
||||
border-radius: 25rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user