Feat:寻看点和抽奖

This commit is contained in:
lifizer
2024-02-06 12:42:46 +08:00
parent c88b6aa8a8
commit f3115fe7c8
73 changed files with 5324 additions and 6887 deletions
+98
View File
@@ -0,0 +1,98 @@
<template>
<scroll-view class="scroll-body" scroll-y @scrolltolower="scrollToLower" v-if="ready">
<view v-for="(group,gIndex) in list" :key="gIndex">
<view style="padding: 24rpx 32rpx 20rpx">
<view style="color:#333333;font-size: 28rpx">{{ group.month }}</view>
<view style="margin-top: 10rpx;color:#999999;font-size: 24rpx">提现{{ group.amount }}</view>
</view>
<view class="logs">
<view class="item flex jc-between" v-for="(item,index) in group['extracts']" :key="index">
<view class="flex">
<image style="width: 48rpx;height: 48rpx" :src="webUrl+'/20240106215333263739.png'" mode="scaleToFill"/>
<view style="margin-left: 10rpx;">
<view style="color:#333333;font-size: 32rpx;">提现
<text class="state-red"
:class="{'state-gray':item['status']===-1,'state-green':item['status']===1}">
({{ item['status'] === -1 ? '提现失败' : item['status'] === 1 ? '已提现' : '提现中' }})
</text>
</view>
<view style="margin-top: 10rpx;color:#666666;font-size: 28rpx">2023-08-21 16:10:10</view>
</view>
</view>
<view style="color:#E92727;font-size: 32rpx;">{{ item['extractPrice'] }}</view>
</view>
</view>
</view>
</scroll-view>
</template>
<script setup>
import {onMounted, ref} from '@vue/composition-api'
import {VUE_APP_RESOURCES_URL as webUrl} from '../../config/index'
import {payoutLog} from "@/api/user";
const ready = ref(false)
onMounted(() => {
fetchData()
ready.value = true
})
const list = ref([])
const page = ref(1)
const fetchData = async () => {
const res = await payoutLog(page.value)
if (res.success) {
let count = 0
for (let i = 0; i < res.data.length; i++) {
count++
list.value.push(res.data[i])
}
if (count < 10 && page.value === 1) scrollToLower()
}
}
const scrollToLower = () => {
page.value++
fetchData()
}
</script>
<style scoped lang="less">
view {
line-height: 1;
}
.scroll-body {
height: 100vh;
}
.logs {
padding: 0 32rpx;
background: #FFFFFF;
.item {
padding: 20rpx 0 26rpx;
border-bottom: 1rpx solid #ECECEE;
}
.item:last-child {
border: none;
}
.state-red {
color: #FD5749;
}
.state-gray {
color: #B3AFAF;
}
.state-green {
color: #2DBA7B;
}
}
</style>