<template>
	<view class="page" :style="{'height':windowHeight}">

		<view class="flex-col" v-if="equityList.length === 0">
			<view class="flex-row justify-center">
				<image class="empty" src="/static/imageIcon/empty.png" mode="widthFix"></image>
			</view>
			<view class="emptyText flex-row justify-center">
				<text>暂无内容</text>
			</view>
		</view>

		<scroll-view v-else scroll-y :style="{'height':windowHeight}">
			<view  class="row-list flex-row justify-start" v-for="(item,index) in equityList" :key="index">
				<view class="h-text flex-col justify-center ">
					<view class="money">
						<text>￥{{item.faceValue}}</text>
					</view>
					<!--				<view class="desc">-->
					<!--					<text>{{item.title}}</text>-->
					<!--				</view>-->
				</view>

				<view class="h-center-content flex-col justify-around">
					<view class="h-value">
						<text>{{item.title}}</text>
					</view>
					<view class="title">
						使用项目：{{item.serviceProjectName || ''}}
					</view>
					<view class="title">
						绑定对象：{{item.serviceObjectName}}
					</view>
					<view class="title">
						结束期限：{{item.effectiveEndTime.substring(0,10)}}
					</view>

				</view>

<!--				<view class="h-right-content flex-col justify-center ">-->
<!--					<view class="btn" @click="payRights(item)">-->
<!--						<text>购买</text>-->
<!--					</view>-->
<!--				</view>-->

			</view>
		</scroll-view>


	</view>
</template>
<script>
	export default {
		data() {
			return {
				windowHeight:'',
				userInfo:{},
				equityList:[],
			};
		},
		onLoad(option) {
			let sysInfo = uni.getSystemInfoSync()
			this.windowHeight =sysInfo.windowHeight - 3 +'px'//除标题栏栏外的屏幕可用高度
			this.userInfo = uni.getStorageSync('userInfo')

			this.myEquityCardList()
		},

		methods: {

			myEquityCardList(){
				this.$api.myEquityCardList().then(res=>{
					console.log(res)
					this.equityList = res.data.data
				})
			},

		},
	};
</script>
<style lang="scss" scoped>

	@import '/common/css/common.css';
	@import './index.rpx.scss';

</style>
