<template>
	<view class="content">
		<view class="onecontentone">
			我的储值卡<text v-if="orderForm.list.length!=0">({{orderForm.list.length}})</text>
		</view>
		<view class="flex-colum">
			<view class="towcontentitem" v-if="orderForm.list.length>0" v-for="(item,index) in orderForm.list"
				:key="index" @click="eeInfo(item)">
				<image class="towcontentitemimage"
					src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/my/recharge.png" mode="aspectFill"></image>
				<view class="towcontentitemone flex-start">
					<image class="towcontentitemoneimage" :src="item.logo" mode="aspectFill"></image>
					<text class="towcontentitemonetext" style="color: #333333;">{{item.chainName}}</text>
					<!-- 余额：<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text> -->
				</view>
				<view class="towcontentitemtow flex-between">
					<text class="towcontentitemtowetext" style="color:#333333;">余额:{{item.amount}}</text>
					<text>{{item.shopName}}</text>
				</view>
			</view>
		</view>
		<view v-if="orderForm.list.length <= 0 " class="flex-colum">
			<image style="width: 402rpx;height: 442rpx;margin:240rpx auto 32rpx;"
				src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png" mode="aspectFill"></image>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive,
		onMounted
	} from 'vue';

	import {
		onReachBottom
	} from '@dcloudio/uni-app'

	import {
		APIusershopUservipCard
	} from '@/common/api/member.js'
	import * as rechargeApi from '@/common/api/market/recharge.js'
	

	const orderForm = reactive({
		type: '', //类型
		list: [],
		is_end: false,
		form: {
			page: 1, //页数
			size: 10, //页容量
			status: 'loadmore',
		}
	})


	const paygetShopByMember = async () => {
		let res = await rechargeApi.list({
			page: orderForm.form.page,
			pageSize: orderForm.form.size,
		})
		orderForm.list = res;
		
	}

	const eeInfo = async (item) => {
		uni.navigateTo({
			url:'/pages/user/member/czzx?shopId='+item.shopId
		})
	}
	onReachBottom(() => {
		// paygetShopByMember()
	})
	onMounted((e) => {
		paygetShopByMember()
	})
</script>

<style lang="scss">
	page {
		background: #FFFFFF;
	}

	.content {
		border-top: 16rpx solid #f7f7f7;
		padding: 28rpx;
		padding-bottom: 40rpx;

		.flex-colum_image {
			display: flex;
			align-items: center;
			justify-content: center;
			height: 100%;

			text {
				margin-top: 30rpx;
				font-size: 32rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				color: #666666;
			}
		}

		.onecontentone {
			font-size: 32rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #333333;
		}

		.flex-colum {
			.towcontentitem {
				margin-top: 22rpx;
				width: 96%;
				position: relative;
				height: 224rpx;
				padding: 32rpx;
				border-radius: 12rpx;

				.towcontentitemimage {
					top: 0;
					left: 0;
					position: absolute;
					width: 100%;
					height: 100%;
					border-radius: 12rpx;
					z-index: 9;
				}

				.towcontentitemone {
					position: relative;
					z-index: 10;

					.towcontentitemoneimage {
						width: 76rpx;
						height: 76rpx;
						border-radius: 50%;
					}

					.towcontentitemonetext {
						width: 60%;
						margin-left: 16rpx;
						font-size: 32rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
						font-family: Source Han Sans CN-Medium, Source Han Sans CN;
						font-weight: 500;
						color: #422A07;
					}
				}

				.towcontentitemtow {
					z-index: 10;
					position: absolute;
					width: 100%;
					left: 0;
					bottom: 18rpx;
					padding: 0 32rpx;
					// margin-top: 52rpx;
					font-size: 24rpx;
					font-family: Source Han Sans CN-Regular, Source Han Sans CN;
					font-weight: 400;
					color: #422A07;
				}
			}
		}

	}
</style>