<template>
	<view class="IntegralRecord">
		<far-bottom></far-bottom>
		<view class="IntegralRecordImg">
			<view><span>{{creditRecordInfo.mycredit}}</span></view>
			<view><span>{{languageStatus!=1?'我的':'내꺼'}}{{textList.credittext}}</span></view>
		</view>

		<!-- 按钮 -->
		<view class="IntegralRecordButton">
			<view @click="go('pages/subPages/signdesk/index/index')">
				<view><image :src="imgfixUrls + 'merchant/jfqd.png'" /></view>
				<span>{{textList.credittext}}{{languageStatus!=1?'签到':'출석체크'}}</span>
			</view>
			<view @click="go('pages/subPages/integral/integralShop/integralShop')">
				<view><image :src="imgfixUrls + 'merchant/jfdh.png'" /></view>
				<span>{{textList.credittext}}{{languageStatus!=1?'兑换':'교환'}}</span>
			</view>
			<view @click="go('pages/subPages2/cleanCustom/cleanCustom')" v-if="textList.flag074 == 1">
				<view><image style="width: 50upx;height: 50upx;margin-top: 10upx;" :src="imageRoot+'gift-fill.png'" /></view>
				<span>{{textList.credittext}}转赠</span>
			</view>
		</view>
		<!-- 按钮 -->

		<!-- 列表区域 -->
		<scroll-view class="IntegralRecordList" :scroll-y="true" @scrolltolower="jfjlLoad">
			<view class="IntegralRecordListPackage">
				<!-- 循环模板 -->
				<view class="IntegralRecordMb" v-for="(item,index) in list" >
					<view>
						<view><span>{{item.remark}}</span></view>
						<view><span>{{item.createtime}}</span></view>
					</view>
					<view v-if="item.num>0"><span>+{{item.num}}</span></view>
					<view v-if="item.num<0"><span>{{item.num}}</span></view>
				</view>
				<!-- 循环模板 -->
				<view class="tips">
					<span>{{ scdpText }}</span>
				</view>
			</view>
		</scroll-view>
		<!-- 列表区域 -->
	</view>
</template>

<script>
import App from '@/common/js/app.js';

// #ifdef H5
import wxApi from '@/common/js/wxApi.js';
// #endif	
	
export default {
	data() {
		return {
			page:1,
			creditRecordInfo:{},
			scdpText:'',
			pagetotal:null,
			list:[],
			textList:{}
		};
	},
	onLoad:function(){
		this.init();
		this.textList = uni.getStorageSync('TextSubstitution');
	},
	methods: {
		init() {
			let _this=this
			_this.creditRecord();
		},
		go(url){
			App.navigationTo({
				url:url
			})
		},
		// 积分余额变更记录
		creditRecord(){
			let _this =this
			_this.scdpText='... ...加载中'
			let data={
				page:_this.page,
				type:1
			}
			App._post_form('&p=member&do=creditRecord',data,res=>{
				_this.creditRecordInfo={..._this.creditRecordInfo,...res.data}
				_this.list=[..._this.list,...res.data.list]
				_this.pagetotal=res.data.pagetotal
				_this.scdpText=''
			})
		},
		// 积分记录下拉加载
		jfjlLoad(){
			let _this=this
			if(_this.pagetotal==_this.page){
				_this.scdpText="没有更多数据了"
			}else{
				_this.page++
				_this.creditRecord();
			}
		}
	},
};
</script>

<style lang="less" scoped>
.tips {
	height: 80upx;
	text-align: center;
	> span {
		line-height: 80upx;
		font-size: 28upx;
		
		
		color: black;
	}
}		
page {
	background: #f6f6f6;
	overflow-x: hidden;
}
.IntegralRecord {
	font-size: 0;
	background: #f6f6f6;
}
.IntegralRecordImg {
	border: 1upx solid rgba(0, 0, 0, 0);
	width: 750upx;
	height: 300upx;
	background: linear-gradient(-59.28999999999999deg, rgba(254, 80, 79, 1) 0%, rgba(254, 133, 79, 1) 100%);
	> view:nth-child(1) {
		margin-top: 50upx;
		text-align: center;
		> span {
			font-size: 70upx;
			
			font-weight: bold;
			color: rgba(255, 255, 255, 1);
		}
	}
	> view:nth-child(2) {
		text-align: center;
		> span {
			font-size: 24upx;
			
			
			color: rgba(255, 255, 255, 1);
		}
	}
}
.IntegralRecordButton {
	margin: -80upx auto 0 auto;
	width: 688upx;
	height: 100upx;
	background: rgba(255, 255, 255, 1);
	border-radius: 10upx;
	display: flex;
	justify-content: space-between;
	> view {
		text-align: center;
		width: 49%;
		> view {
			margin-top: 17upx;
			width: 73upx;
			height: 74upx;
			display: inline-block;
			vertical-align: top;
			> image {
				width: 73upx;
				height: 74upx;
			}
		}
		> span {
			line-height: 100upx;
			vertical-align: top;
			font-size: 28upx;
			
			
			color: rgba(51, 51, 51, 1);
		}
	}
}
.IntegralRecordList {
	margin: 20upx auto 0 auto;
	width: 690upx;
	height: 870upx;
	background: rgba(255, 255, 255, 1);
	border-radius: 10upx;
}
.IntegralRecordListPackage {
	padding: 0 30upx 30upx 30upx;
}
.IntegralRecordMb {
	border-bottom: 1upx solid rgba(246, 246, 246, 1);
	padding: 30upx 0;
	display: flex;
	justify-content: space-between;
	> view:nth-child(1) {
		> view:nth-child(1) {
			> span {
				font-size: 28upx;
				color: rgba(51, 51, 51, 1);
			}
		}
		> view:nth-child(2) {
			> span {
				font-size: 24upx;
				color: rgba(153, 153, 153, 1);
			}
		}
	}
	> view:nth-child(2) {
		> span {
			line-height: 70upx;
			font-size: 30upx;
			
			font-weight: bold;
			color: rgba(244, 79, 68, 1);
		}
	}
	>view{
		display: inline-block;
	}
}
</style>
