385 lines
7.4 KiB
Plaintext
385 lines
7.4 KiB
Plaintext
<template>
|
|
<view class="point-records-page">
|
|
<!-- 沉浸式状态栏 -->
|
|
<view class="status-bar"></view>
|
|
|
|
<!-- 顶部导航 -->
|
|
<view class="nav-bar">
|
|
<image class="back-icon" src="/static/icons/back.svg" @click="Service.GoPageBack()" mode="aspectFit" />
|
|
<text class="nav-title">余额明细</text>
|
|
<view class="nav-placeholder"></view>
|
|
</view>
|
|
|
|
<!-- 主要内容区域 -->
|
|
<view class="content">
|
|
<!-- 当前积分区域 -->
|
|
<view class="points-detail-section" style="margin-bottom: 20rpx;">
|
|
<view class="" style="display: flex; align-items: center; justify-content: space-between;">
|
|
<view class="" style="font-size: 30rpx; color: #999;">
|
|
余额
|
|
</view>
|
|
<view class="" style="color: red; font-weight: bold; font-size: 34rpx; ">
|
|
{{ integral }}
|
|
</view>
|
|
</view>
|
|
<view class="" style="margin-top: 20rpx;">
|
|
<u-button @click="Service.GoPage('/pages/userFunc/withdrow')"
|
|
:custom-style="contactButtonStyle">立即提现</u-button>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 筛选标签 -->
|
|
<view class="filter-tabs">
|
|
<view v-for="(tab, index) in filterTabs" :key="index" class="filter-tab"
|
|
:class="{ active: currentFilter === tab }" @click="currentFilter = tab;getUseraccInfo()">
|
|
{{ tab }}
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 积分记录列表 -->
|
|
<view class="records-list">
|
|
<view v-for="(record, index) in pointsList" :key="index" class="record-item">
|
|
<view class="record-info">
|
|
<view class="record-header">
|
|
<text class="record-title">{{ record.name }}</text>
|
|
<text class="record-amount"
|
|
:class="record.code=='收入'?'earn':'spend'">{{record.code=='收入'?'+':'-'}}{{ record.amount }}</text>
|
|
</view>
|
|
<text class="record-desc">{{ record.remark }}</text>
|
|
<text class="record-time">{{ record.addTime }}</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 空状态 -->
|
|
<view v-if="pointsList.length === 0" class="empty-state">
|
|
<text class="ri-leaf-line empty-icon"></text>
|
|
<text class="empty-text">暂无积分记录</text>
|
|
</view>
|
|
<up-loadmore v-else :status="status" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref } from 'vue';
|
|
import { vpUserService } from '@/Service/vp/vpUserService'
|
|
import { Service, vpMerchService } from '@/Service/vp/vpMerchService'
|
|
import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
|
// 积分明细数据类型
|
|
interface PointsItem {
|
|
amount : number
|
|
code : string
|
|
name : string
|
|
addTime : string
|
|
remark:string
|
|
}
|
|
|
|
// 按钮样式
|
|
const contactButtonStyle = ref({
|
|
background: 'linear-gradient(135deg, #FF6B00, #FF9500)',
|
|
color: '#FFFFFF',
|
|
fontSize: '28rpx',
|
|
height: '85rpx',
|
|
borderRadius: '45rpx',
|
|
marginRight: '20rpx'
|
|
});
|
|
|
|
let integral = ref(0)
|
|
let status = ref('loadmore')
|
|
let page = ref(1)
|
|
// 积分明细数据
|
|
const pointsList = ref<PointsItem[]>([
|
|
|
|
]);
|
|
|
|
|
|
const filterTabs = [ '全部','支出','收入']
|
|
|
|
const currentFilter = ref('全部')
|
|
|
|
|
|
onLoad(() => {
|
|
getUseraccInfo()
|
|
})
|
|
|
|
|
|
|
|
onReachBottom(() => {
|
|
getList()
|
|
})
|
|
|
|
|
|
|
|
const getUseraccInfo = () => {
|
|
|
|
status.value = 'loadmore'
|
|
page.value = 1
|
|
pointsList.value = []
|
|
getList()
|
|
}
|
|
|
|
|
|
const getList = () => {
|
|
|
|
if (status.value !== 'loadmore') {
|
|
return
|
|
}
|
|
status.value = 'loading'
|
|
vpMerchService.GetMerchAccInfo(currentFilter.value=='全部'?'':currentFilter.value , page.value).then(res => {
|
|
integral.value = res.data.merchAcc.integral
|
|
pointsList.value = [...pointsList.value, ...res.data.merchAccLog]
|
|
status.value = res.data.merchAccLog.length == 10 ? 'loadmore' : 'nomore'
|
|
page.value++
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.point-records-page {
|
|
min-height: 100vh;
|
|
background: #F5F5F5;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
|
|
/* 积分明细 */
|
|
.points-detail-section {
|
|
background-color: #ffffff;
|
|
padding: 40rpx 30rpx;
|
|
border-radius: 20rpx;
|
|
}
|
|
|
|
/* 状态栏 */
|
|
.status-bar {
|
|
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
|
height: var(--status-bar-height);
|
|
width: 100%;
|
|
}
|
|
|
|
/* 导航栏 */
|
|
.nav-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 60rpx 24rpx 20rpx 24rpx;
|
|
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
|
}
|
|
|
|
.back-icon {
|
|
width: 48rpx;
|
|
height: 48rpx;
|
|
padding: 8rpx;
|
|
}
|
|
|
|
.nav-title {
|
|
font-size: 36rpx;
|
|
font-weight: 600;
|
|
color: #FFFFFF;
|
|
}
|
|
|
|
.nav-placeholder {
|
|
width: 48rpx;
|
|
}
|
|
|
|
/* 内容区域 */
|
|
.content {
|
|
flex: 1;
|
|
padding: 24rpx;
|
|
}
|
|
|
|
/* 积分统计区域 */
|
|
.stats-section {
|
|
margin-bottom: 24rpx;
|
|
}
|
|
|
|
.stats-card {
|
|
background: #FFFFFF;
|
|
border-radius: 24rpx;
|
|
padding: 32rpx 24rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
|
}
|
|
|
|
.stat-item {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 12rpx;
|
|
}
|
|
|
|
.stat-icon {
|
|
font-size: 48rpx;
|
|
color: #FF6B00;
|
|
}
|
|
|
|
.stat-icon.earn {
|
|
color: #10B981;
|
|
}
|
|
|
|
.stat-icon.spend {
|
|
color: #F44336;
|
|
}
|
|
|
|
.stat-info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 4rpx;
|
|
}
|
|
|
|
.stat-value {
|
|
font-size: 40rpx;
|
|
font-weight: 700;
|
|
color: #222222;
|
|
line-height: 1;
|
|
}
|
|
|
|
.stat-label {
|
|
font-size: 22rpx;
|
|
color: #999999;
|
|
}
|
|
|
|
.stat-divider {
|
|
width: 1rpx;
|
|
background: rgba(0, 0, 0, 0.08);
|
|
height: 60rpx;
|
|
}
|
|
|
|
/* 筛选标签 */
|
|
.filter-tabs {
|
|
background: #FFFFFF;
|
|
border-radius: 16rpx;
|
|
padding: 8rpx;
|
|
margin-bottom: 24rpx;
|
|
display: flex;
|
|
gap: 8rpx;
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
.filter-tab {
|
|
flex: 1;
|
|
text-align: center;
|
|
padding: 16rpx 0;
|
|
font-size: 26rpx;
|
|
color: #666666;
|
|
border-radius: 12rpx;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.filter-tab.active {
|
|
background: linear-gradient(135deg, #FF6B00, #FF9500);
|
|
color: #FFFFFF;
|
|
font-weight: 500;
|
|
}
|
|
|
|
/* 记录列表 */
|
|
.records-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16rpx;
|
|
}
|
|
|
|
.record-item {
|
|
background: #FFFFFF;
|
|
border-radius: 16rpx;
|
|
padding: 24rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 20rpx;
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
.record-icon-box {
|
|
width: 72rpx;
|
|
height: 72rpx;
|
|
border-radius: 16rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.record-icon-box.earn {
|
|
background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
|
|
}
|
|
|
|
.record-icon-box.earn text {
|
|
font-size: 36rpx;
|
|
color: #10B981;
|
|
}
|
|
|
|
.record-icon-box.spend {
|
|
background: linear-gradient(135deg, #FFEBEE, #FFCDD2);
|
|
}
|
|
|
|
.record-icon-box.spend text {
|
|
font-size: 36rpx;
|
|
color: #F44336;
|
|
}
|
|
|
|
.record-info {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8rpx;
|
|
}
|
|
|
|
.record-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.record-title {
|
|
font-size: 28rpx;
|
|
font-weight: 500;
|
|
color: #222222;
|
|
}
|
|
|
|
.record-amount {
|
|
font-size: 32rpx;
|
|
font-weight: 600;
|
|
color: #10B981;
|
|
}
|
|
|
|
.record-amount.spend {
|
|
color: #F44336;
|
|
}
|
|
|
|
.record-desc {
|
|
font-size: 24rpx;
|
|
color: #666666;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.record-time {
|
|
font-size: 22rpx;
|
|
color: #999999;
|
|
}
|
|
|
|
/* 空状态 */
|
|
.empty-state {
|
|
background: #FFFFFF;
|
|
border-radius: 16rpx;
|
|
padding: 80rpx 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 16rpx;
|
|
}
|
|
|
|
.empty-icon {
|
|
font-size: 80rpx;
|
|
color: #CCCCCC;
|
|
}
|
|
|
|
.empty-text {
|
|
font-size: 26rpx;
|
|
color: #999999;
|
|
}
|
|
</style> |