第一次上传
This commit is contained in:
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<view style="padding: 20rpx; ">
|
||||
|
||||
|
||||
<!-- 当前积分区域 -->
|
||||
<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 type="primary" @click="Service.GoPage('/pages/userFunc/withdrow')"
|
||||
:custom-style="contactButtonStyle">立即提现</u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分明细 -->
|
||||
<view class="points-detail-section">
|
||||
<text class="section-title">积分明细</text>
|
||||
<view class="points-list">
|
||||
<view class="points-item" v-for="(item, index) in pointsList" :key="index">
|
||||
<text :class="['points-number', item.code=='收入' ? 'positive' : 'negative']">
|
||||
{{ item.code=='收入' ? '+' : '-' }}{{ item.amount }}
|
||||
</text>
|
||||
<view class="" style="margin-left: 20rpx;">
|
||||
<view class="points-type" style="font-size: 26rpx; font-weight: bold; ">{{ item.name }}</view>
|
||||
<view class="points-date" style="margin-top: 4rpx;">{{ Service.formatDate(item.addTime,1) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="pointsList.length==0" class="" style=" font-size: 28rpx; text-align: center;padding: 10rpx 0;">
|
||||
暂无记录
|
||||
</view>
|
||||
<up-loadmore v-if="pointsList.length!==0" :status="status" />
|
||||
</view>
|
||||
|
||||
<!-- <scroll-view scroll-y="true" class="scroll-Y" >
|
||||
<text class="section-title">积分明细</text>
|
||||
<view class="points-list">
|
||||
<view class="points-item" v-for="(item, index) in pointsList" :key="index">
|
||||
<text :class="['points-number', item.code=='收入' ? 'positive' : 'negative']">
|
||||
{{ item.code=='收入' ? '+' : '-' }}{{ item.amount }}
|
||||
</text>
|
||||
<view class="" style="margin-left: 20rpx;">
|
||||
<view class="points-type" style="font-size: 26rpx; font-weight: bold; ">{{ item.name }}</view>
|
||||
<view class="points-date" style="margin-top: 4rpx;">{{ Service.formatDate(item.addTime,1) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="pointsList.length==0" class="" style=" font-size: 28rpx; text-align: center;padding: 10rpx 0;">
|
||||
暂无记录
|
||||
</view>
|
||||
<up-loadmore v-if="pointsList.length!==0" :status="status" />
|
||||
</scroll-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
|
||||
}
|
||||
|
||||
// 按钮样式
|
||||
const contactButtonStyle = ref({
|
||||
backgroundColor: '#FF6600',
|
||||
borderColor: '#FF6600',
|
||||
color: '#FFFFFF',
|
||||
fontSize: '28rpx',
|
||||
height: '75rpx',
|
||||
borderRadius: '45rpx',
|
||||
marginRight: '20rpx'
|
||||
});
|
||||
|
||||
let integral = ref(0)
|
||||
let status = ref('loadmore')
|
||||
let page = ref(1)
|
||||
// 积分明细数据
|
||||
const pointsList = ref<PointsItem[]>([
|
||||
|
||||
]);
|
||||
|
||||
|
||||
onLoad(() => {
|
||||
getUseraccInfo()
|
||||
})
|
||||
|
||||
|
||||
|
||||
onReachBottom(() => {
|
||||
console.log(1111);
|
||||
getList()
|
||||
})
|
||||
|
||||
|
||||
|
||||
const getUseraccInfo = () => {
|
||||
|
||||
status.value = 'loadmore'
|
||||
page.value = 1
|
||||
pointsList.value = []
|
||||
getList()
|
||||
}
|
||||
|
||||
|
||||
const getList = () => {
|
||||
|
||||
if (status.value !== 'loadmore') {
|
||||
return
|
||||
}
|
||||
status.value = 'loading'
|
||||
vpMerchService.GetMerchAccInfo(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">
|
||||
page {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
|
||||
/* 积分明细 */
|
||||
.points-detail-section {
|
||||
background-color: #ffffff;
|
||||
padding: 40rpx 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.points-list {
|
||||
gap: 36rpx;
|
||||
}
|
||||
|
||||
.points-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
.points-item:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.points-type {
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.points-number {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 24rpx;
|
||||
min-width: 80rpx;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.points-number.positive {
|
||||
color: #4CD964;
|
||||
}
|
||||
|
||||
.points-number.negative {
|
||||
color: #FF4D4F;
|
||||
}
|
||||
|
||||
.points-date {
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user