<template>
	<view class="">
		<view v-if="orderList.length">
			<view class="flex align-center margin-bottom-sm bg padding-sm radius margin-sm"
				v-for="(item,index) in orderList" :key='index'
				style="box-shadow: 6rpx 10rpx 4px #F5F5F5;position: relative;">
				<view style="width:100upx;height:100upx;border-radius: 10rpx;">
					<image :src="item.userEntity.avatar?item.userEntity.avatar: '../../static/logo.png'"
						style="width: 100upx;height: 100upx;border-radius: 50%;" mode="aspectFill"></image>
				</view>
				<view class="margin-left  flex flex-direction" style="width: 85%;">
					<view class="flex align-center justify-between">
						<view class="flex align-center">
							<view class="text-bold text-30 margin-right-xs">{{item.userEntity.userName}}</view>
						</view>
					</view>
					<view style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
						<view class="text-center text-sm"
							style="color: #096f4b;font-size: 28rpx;margin-top: 10rpx;">
							为我储值，剩余额度：￥{{item.money}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<empty v-if="orderList.length == 0"></empty>
	</view>
</template>

<script>
	import empty from '@/components/empty.vue'
	export default {
		components: {
			empty
		},
		data() {
			return {
				consortiaId: '',
				loading: true, // 是否显示骨架屏组件
				orderList: [],
				page: 1,
				limit: 10,
				token: '',
				isVip: false,
				myId: uni.getStorageSync('userId') ? uni.getStorageSync('userId') : '',
			}
		},
		onLoad(e) {
			this.consortiaId = e.consortiaId;
			let that = this
			that.page = 1
			that.getlist()
		},
		onShow() {
			let that = this
			that.token = uni.getStorageSync('token')
			that.myId = uni.getStorageSync('userId')
		},
		methods: {
			saveImgss(imgs, index) {
				console.log(imgs, index)
				let imgArr = imgs
				// //预览图片
				uni.previewImage({
					urls: imgArr,
					current: imgArr[index]
				});
			},
			saveImgs(imgs) {
				let imgArr = [];
				imgArr.push(imgs);
				// //预览图片
				uni.previewImage({
					urls: imgArr,
					current: 0
				});
			},
			getlist() {
				let userId = this.$queue.getData('userId');
				this.$Request.getT('/app/userMoney/selectUserMoneyArtificers?page=' + this.page + '&limit=' + this.limit + '&artificerId=' + uni.getStorageSync('artificerId')).then(res =>{
					if(res.code == 0){
						if (this.page == 1) {
							this.orderList = res.data.list
						} else {
							this.orderList = [...this.orderList, ...res.data.list]
						}
					}
					uni.stopPullDownRefresh();
				});
			}
		},
		onReachBottom: function() {
			this.page = this.page + 1;
			this.getlist()
		},
		onPullDownRefresh: function() {
			this.page = 1;
			this.getlist()
		},
	}
</script>

<style lang="scss">
	page {
		background-color: #F7F7F7;
	}

	.zz_view {
		// width: 220upx;
		background: #e8fdf6;
		color: #73c2a2;
		font-size: 24rpx;
		padding: 6rpx 10rpx;
		border-radius: 10rpx;
	}

	.zpmore_view {
		background: #096f4b;
		width: 120upx;
		text-align: center;
		border-radius: 10rpx;
		height: 42rpx;
		line-height: 42rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		margin-left: 10rpx;
	}

	.byy_view {
		// background: #096f4b;
		width: 120upx;
		text-align: center;
		border-radius: 50rpx;
		height: 46rpx;
		line-height: 46rpx;
		font-size: 24rpx;
		color: #999999;
		border: 1upx solid #999999;
		margin-top: 6rpx;
	}

	.kyy_view {
		background: #096f4b;
		width: 120upx;
		text-align: center;
		border-radius: 50rpx;
		height: 46rpx;
		line-height: 46rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		margin-top: 6rpx;
	}

	.bg {
		background: #FFFFFF;
	}

	.ytp_view {
		background: #e3e3e3;
		width: 400rpx;
		border-radius: 10rpx;
		font-size: 28rpx;
		text-align: center;
		height: 80rpx;
		line-height: 80rpx;
		color: #848484;
		margin-top: 40rpx;
	}

	.tp_view {
		background: #ee6c54;
		width: 400rpx;
		border-radius: 10rpx;
		font-size: 28rpx;
		text-align: center;
		height: 80rpx;
		line-height: 80rpx;
		color: #FFFFFF;
		margin-top: 40rpx;
	}

	.sticky-tabs {
		z-index: 990;
		position: sticky;
		top: var(--window-top);
		// background-color: #fff;
	}

	/* // 使用mescroll-uni,则top为0 */
	.mescroll-uni,
	/deep/.mescroll-uni {
		.sticky-tabs {
			top: 0;
		}
	}

	.demo-tip {
		padding: 18upx;
		font-size: 24upx;
		text-align: center;
	}

	.line_s {
		display: inline-flex;
		width: 10rpx;
		height: 10rpx;
		background: #1AD566;
		border-radius: 50%;
		margin-right: 10rpx;
	}

	.line_x {
		display: inline-flex;
		width: 10rpx;
		height: 10rpx;
		background: #000000;
		border-radius: 50%;
		margin-right: 10rpx;
	}

	.box {
		// border: 3rpx solid #005dff;
		background: #E8FAE1;
		color: #096f4b;
		padding: 5rpx 15rpx;
		font-size: 26rpx;
		letter-spacing: 2rpx;
		border-radius: 8rpx;
		// margin-top: 10rpx;
		margin-right: 8upx;
	}

	.actve {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 800;
		color: #20C675;
	}

	.tabview1 {
		padding: 20rpx 20rpx;
		// width: 686upx;
		// height: 100upx;
		background: #FFFFFF;
		margin-top: 60upx;
		// z-index: 99;
		// display: flex;
		// line-height: 100upx;

		.tabview {
			// width: 686upx;
			// // height: 100upx;
			background: #F2FFF9;
			border-radius: 24rpx 24rpx 0 0;
			// margin-top: -50upx;
			// z-index: 99;
			display: flex;
			line-height: 100upx;

			.tabItem_sel {
				font-size: 30upx;
				font-family: PingFang SC;
				font-weight: 800;
				color: #20C675;
				flex: 1;
				text-align: center;
			}

			.tabItem {
				font-size: 26upx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #333333;
				flex: 1;
				text-align: center;
			}
		}

		.tabsx {
			width: 686upx;
			border-radius: 24rpx;
			padding-bottom: 10rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 20rpx 30rpx;
			font-size: 26rpx;

			.active {
				color: #20C675;
				font-size: 30rpx;
				font-weight: bold;
			}
		}
	}
</style>