You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							230 lines
						
					
					
						
							5.7 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							230 lines
						
					
					
						
							5.7 KiB
						
					
					
				
								<template>
							 | 
						|
									<view>
							 | 
						|
										<lf-nav title="积分" :showIcon="true" :spreadOut="false" bgColor="transparent" titleColor="#fff"></lf-nav>
							 | 
						|
										<view class="head">
							 | 
						|
											<view class="bg-left"></view>
							 | 
						|
											<view class="bg-right"></view>
							 | 
						|
											<view class="head-content">
							 | 
						|
												<view>
							 | 
						|
													<text class="lf-iconfont icon-jifen lf-font-50"></text>
							 | 
						|
												</view>
							 | 
						|
												<view class="point">{{point_data.point}}</view>
							 | 
						|
												<view class="head-menu">
							 | 
						|
													<view @click="$url('/pages/point/shoppingMall/shoppingMall')">
							 | 
						|
														<text class="lf-m-r-10">兑换礼品</text>
							 | 
						|
														<text class="lf-iconfont icon-xiangyou lf-font-20"></text>
							 | 
						|
													</view>
							 | 
						|
													<view @click="$url('/pages/point/rule/rule')">
							 | 
						|
														<text class="lf-m-r-10">积分规则</text>
							 | 
						|
														<text class="lf-iconfont icon-xiangyou lf-font-20"></text>
							 | 
						|
													</view>
							 | 
						|
												</view>
							 | 
						|
											</view>
							 | 
						|
										</view>
							 | 
						|
										<view class="main">
							 | 
						|
											<view class="lf-row-between lf-m-b-30">
							 | 
						|
												<view class="lf-font-32 lf-color-black lf-font-bold">积分变动明细</view>
							 | 
						|
												<picker mode='date' :value="date" @change="dateChange">
							 | 
						|
													<view style="width: 440rpx; text-align: right;">
							 | 
						|
														<text>{{ date || '2021-09-01' }}</text>
							 | 
						|
														<text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text>
							 | 
						|
													</view>
							 | 
						|
												</picker>
							 | 
						|
											</view>
							 | 
						|
											<scroll-view :style="{height: autoHeight}" :scroll-y="true" :refresher-enabled="true" :refresher-triggered="isRefresher"
							 | 
						|
												@scrolltolower="onScrolltolower" @refresherrefresh="onRefresherrefresh">
							 | 
						|
													<view class="item" v-for="(item, index) in list" :key="index">
							 | 
						|
														<view class="lf-row-between">
							 | 
						|
															<text class="lf-font-36 lf-color-black lf-font-bold" :class="{'lf-color-price': index % 2}">{{ index % 2 ? '-250' : '+80' }}</text>
							 | 
						|
															<text class="lf-font-24 lf-color-777">2021-09-01 18:27:58</text>
							 | 
						|
														</view>
							 | 
						|
														<view class="lf-m-t-20">
							 | 
						|
															<text class="lf-font-24 lf-color-555">商城内消费</text>
							 | 
						|
														</view>
							 | 
						|
													</view>
							 | 
						|
													<!-- 空数据的情况 -->
							 | 
						|
													<view class="loading-more">
							 | 
						|
														<text v-if="list.length != 0"
							 | 
						|
															:class="{'loading-more-text': loadingClass}">{{ loadingText }}</text>
							 | 
						|
														<lf-nocontent src="/static/images/empty.png" v-else></lf-nocontent>
							 | 
						|
													</view>
							 | 
						|
											</scroll-view>
							 | 
						|
										</view>
							 | 
						|
									</view>
							 | 
						|
								</template>
							 | 
						|
								
							 | 
						|
								<script>
							 | 
						|
									export default {
							 | 
						|
										data(){
							 | 
						|
											return {
							 | 
						|
												date: '',
							 | 
						|
												point_data: '',
							 | 
						|
												list: [],
							 | 
						|
												page: 1,
							 | 
						|
												isPage: true,
							 | 
						|
												loadingClass: true,
							 | 
						|
												loadingText: '正在加载中',
							 | 
						|
												scrollH: 0,
							 | 
						|
												nav_height: 0,
							 | 
						|
												isRefresher: true,
							 | 
						|
												pageSize: 10
							 | 
						|
											}
							 | 
						|
										},
							 | 
						|
										computed: {
							 | 
						|
											autoHeight(){
							 | 
						|
												return `calc(${this.scrollH}px - ${this.nav_height}px - 660rpx)`;
							 | 
						|
											}
							 | 
						|
										},
							 | 
						|
										onLoad(){
							 | 
						|
											let info = uni.getSystemInfoSync();
							 | 
						|
											this.scrollH = info.screenHeight;
							 | 
						|
											this.getPointNum();
							 | 
						|
											this.getPointList();
							 | 
						|
										},
							 | 
						|
										methods: {
							 | 
						|
											dateChange(event){
							 | 
						|
												this.date = event.detail.value;
							 | 
						|
											},
							 | 
						|
											getPointNum(){
							 | 
						|
												this.$http.get({
							 | 
						|
													api: 'api/users/point',
							 | 
						|
													header: {
							 | 
						|
													    Authorization: this.$cookieStorage.get('user_token')
							 | 
						|
													}
							 | 
						|
												}).then(res => {
							 | 
						|
													this.point_data = res.data.data
							 | 
						|
													console.log(this.point_data)
							 | 
						|
												})
							 | 
						|
											},
							 | 
						|
											// 页面触底,加载下一页
							 | 
						|
											onScrolltolower(){
							 | 
						|
												if(this.isPage){
							 | 
						|
													this.page = this.page + 1;
							 | 
						|
													this.getMyActivity();
							 | 
						|
												}
							 | 
						|
											},
							 | 
						|
											// 下拉刷新处理
							 | 
						|
											refreshFn(options){
							 | 
						|
												this.page = 1;
							 | 
						|
												this.isPage = true;
							 | 
						|
												this.loadingClass = true;
							 | 
						|
												this.list = []
							 | 
						|
												this.loadingText = '正在加载中';
							 | 
						|
												this.getPointList(options);
							 | 
						|
											},
							 | 
						|
											// scroll-view 下拉刷新
							 | 
						|
											onRefresherrefresh(){
							 | 
						|
												this.isRefresher = true;
							 | 
						|
												this.refreshFn({type: 'scrollRefresh'});
							 | 
						|
											},
							 | 
						|
											getPointList(options = {}){
							 | 
						|
												this.$http.get({
							 | 
						|
													api: 'api/users/point/list',
							 | 
						|
													header: {
							 | 
						|
													    Authorization: this.$cookieStorage.get('user_token')
							 | 
						|
													}
							 | 
						|
												}).then(res => {
							 | 
						|
													console.log("----", res);
							 | 
						|
													let isPage = this.page < res.data.meta.pagination.total_pages?true:false;
							 | 
						|
													this.isPage = isPage;
							 | 
						|
													if(!isPage) {
							 | 
						|
														this.loadingClass = false;
							 | 
						|
														this.loadingText = '没有更多数据啦~';
							 | 
						|
													}
							 | 
						|
													if(options.type == 'pageRefresh') {
							 | 
						|
														uni.stopPullDownRefresh();
							 | 
						|
													}else if(options.type == 'scrollRefresh') {
							 | 
						|
														this.isRefresher = false;
							 | 
						|
													}
							 | 
						|
													if(this.page == 1) {
							 | 
						|
														this.list = res.data.data;
							 | 
						|
													}else {
							 | 
						|
														this.list.push(...res.data.data);
							 | 
						|
													}
							 | 
						|
													
							 | 
						|
												})
							 | 
						|
											}
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
								</script>
							 | 
						|
								
							 | 
						|
								<style>
							 | 
						|
									page{
							 | 
						|
										overflow-x: hidden;
							 | 
						|
									}
							 | 
						|
								</style>
							 | 
						|
								<style lang="scss" scoped="scoped">
							 | 
						|
									.head{
							 | 
						|
										width: 750rpx;
							 | 
						|
										height: 512rpx;
							 | 
						|
										background: linear-gradient(90deg, #22A2A0 0%, #187B7A 100%);
							 | 
						|
										position: relative;
							 | 
						|
										overflow: hidden;
							 | 
						|
										display: flex;
							 | 
						|
										align-items: flex-end;
							 | 
						|
										box-sizing: border-box;
							 | 
						|
										padding: 60rpx 32rpx;
							 | 
						|
										color: #FFFFFF;
							 | 
						|
										.bg-left{
							 | 
						|
											position: absolute;
							 | 
						|
											width: 196rpx;
							 | 
						|
											height: 196rpx;
							 | 
						|
											border-radius: 50%;
							 | 
						|
											background-color: rgba(255,255,255,0.04);
							 | 
						|
											left: -92rpx;
							 | 
						|
											bottom: 60rpx;
							 | 
						|
										}
							 | 
						|
										.bg-right{
							 | 
						|
											position: absolute;
							 | 
						|
											width: 520rpx;
							 | 
						|
											height: 520rpx;
							 | 
						|
											border-radius: 50%;
							 | 
						|
											background-color: rgba(255,255,255,0.04);
							 | 
						|
											right: -168rpx;
							 | 
						|
											top: -122rpx;
							 | 
						|
										}
							 | 
						|
										.head-content{
							 | 
						|
											width: 100%;
							 | 
						|
											display: flex;
							 | 
						|
											flex-direction: column;
							 | 
						|
											justify-content: center;
							 | 
						|
											align-items: center;
							 | 
						|
											&>view{
							 | 
						|
												width: 100%;
							 | 
						|
												text-align: center;
							 | 
						|
											}
							 | 
						|
											.head-menu{
							 | 
						|
												display: flex;
							 | 
						|
												justify-content: space-between;
							 | 
						|
												padding: 0 78rpx;
							 | 
						|
												font-size: 24rpx;
							 | 
						|
												margin-top: 50rpx;
							 | 
						|
											}
							 | 
						|
											.point{
							 | 
						|
												font-size: 72rpx;
							 | 
						|
												letter-spacing: 2rpx;
							 | 
						|
												font-weight: bold;
							 | 
						|
												word-break: break-all;
							 | 
						|
												line-height: 1;
							 | 
						|
												margin-top: 10rpx;
							 | 
						|
											}
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
									
							 | 
						|
									.main{
							 | 
						|
										padding: 30rpx 32rpx;
							 | 
						|
										width: 750rpx;
							 | 
						|
										height: max-content;
							 | 
						|
										box-sizing: border-box;
							 | 
						|
										.item{
							 | 
						|
											width: 686rpx;
							 | 
						|
											height: max-content;
							 | 
						|
											background: #F4F8F8;
							 | 
						|
											border-radius: 10rpx;
							 | 
						|
											margin-bottom: 26rpx;
							 | 
						|
											padding: 30rpx;
							 | 
						|
											box-sizing: border-box;
							 | 
						|
											line-height: 1;
							 | 
						|
										}
							 | 
						|
									}
							 | 
						|
								</style>
							 |