myIntegral.vue 3.5 KB
<template>
	<view class="page">
		<view class="box">
			<view class="myIntegral">
				<view class="title">当前积分</view>
				<view class="num">{{score}}</view>
			</view>
			<view class="banner" @click="jiugongge">
				<image src="../../static/choujian.png" mode="widthFix"></image>
			</view>
			<view class="list">
				<view class="xtitle">积分收支明细</view>
				<view class="item" v-for="(item,index) in myintervalarr" :key="index">
					<view class="left">
						<view class="name" v-if="item.type==1">新用户赠送</view>
						<view class="name" v-if="item.type==2">抽奖消耗</view>
						<view class="name" v-if="item.type==3">抽奖获得</view>
						<view class="name" v-if="item.type==4">购物获得</view>
						<view class="name" v-if="item.type==5">积分抵扣</view>
						<view class="name" v-if="item.type==6">签到获得</view>
						<view class="time">{{item.createtime}}</view>
					</view>
					<view class="money">{{item.score}}</view>
				</view>
				
			
			</view>
		</view>
	</view>
</template>

<script>
	import app from "../../App.vue";
	export default {
		data() {
			return {
				myintervalarr:[],
				page:1,
				score:''
			}
		},
		onLoad() {
			this.getmyinterval();
			this.getuserinfo();
		},
		methods: {
			
			// 获取用户信息
			getuserinfo() {
				let that = this;
				var url = 'member/index';
				var params = {
			
				}
				console.log('7766554', params)
				app.post(url, params).then((res) => {
					console.log(res);
					that.score=res.data.data.score
			
			
				}).catch((err) => {
			
				})
			},
			// 获取我的积分
			getmyinterval(){
				let that = this;
				var url = 'score/get_list';
				var params = {
					page:that.page,
					pageNum:10
				}
				console.log('7766554', params)
				app.post(url, params).then((res) => {
					console.log(res);
					that.myintervalarr=that.myintervalarr.concat(res.data.data)
				}).catch((err) => {
				
				})
			},
			// 九宫格
			jiugongge(){
				uni.navigateTo({
					url:'/pages/homepage/drawlottery'
				})
			},
		},
		onReachBottom() {
			let newpage=this.page;
			newpage++;
			this.page=newpage;
			this.getmyinterval()
		}
	}
</script>

<style>
	.box{
		background: #fff;
	}
	.myIntegral{
		padding: 60rpx 0 42rpx;
		box-sizing: border-box;
	}
	.title{
		font-size:32rpx;
		font-family:PingFangHK-Regular,PingFangHK;
		font-weight:400;
		color:rgba(8,18,31,1);
		text-align: center;
	}
	.num{
		font-size:72rpx;
		font-family:PingFangHK-Medium,PingFangHK;
		font-weight:500;
		color:rgba(194,148,69,1);
		text-align: center;
		margin-top: 32rpx;
	}
	.banner{
		width:100%x;
		height:260rpx;
		background:rgba(247,247,247,1);
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.banner image{
		width: 686rpx;
	}
	.list{
		padding: 0 36rpx;
		box-sizing: border-box;
	}
	.xtitle{
		height: 92rpx;
		display: flex;
		align-items: center;
		font-size:32rpx;
		font-family:PingFangSC-Medium,PingFang SC;
		font-weight:600;
		color:rgba(35,35,35,1);
	}
	.item{
		height: 128rpx;
		border-top: 1px solid #EEEEEE;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.left{
		width: 50^;
	}
	.name{
		font-size:32rpx;
		font-family:PingFangSC-Regular,PingFang SC;
		font-weight:400;
		color:rgba(35,35,35,1);
	}
	.time{
		font-size:24rpx;
		font-family:PingFangSC-Medium,PingFang SC;
		font-weight:500;
		color:rgba(187,194,203,1);
		margin-top: 10rpx;
	}
	.money{
		font-size:36rpx;
		font-family:PingFangSC-Regular,PingFang SC;
		font-weight:400;
		color:rgba(255,148,23,1);
	}
</style>