<template>
	<view class="paper-index box-sizing-border">
		<view class="close-box sys-background-gray-f">
			<uni-icons type="closeempty" size="14" @click="to(1)"></uni-icons>
		</view>
		<view class="box-info box-sizing-border">
			<view class="box-1">
				<image src="@/static/img/wallet/people.png" mode="scaleToFill"></image>
				<view class="box-2 mb-8 sys-size-40 sys-color-white sys-weight-600">小纸条</view>
			</view>
			<view class="mb-38 sys-size-28 sys-color-white">直接私信留言</view>
			
			
			<scroll-view scroll-x="true" class="scroll-list-x sys-background-gray-f box-sizing-border">
				<view v-if="false" class="list-n sys-size-28 sys-color-gray-9 sys-weight-600">暂无数据</view>
				<view v-else class="list-box" v-for="(item,i) in list" :key="i" @click="to(4,item)"
				:class="shopId===item.id?'view-s':'view-n'">
					<view class="incon-s" v-if="shopId===item.id">
						<image src="@/static/img/wallet/icon-s.png" mode=""></image>
						<text class="sys-size-20 sys-color-white">立省35元</text>
					</view>
					<view class="incon-s" v-else>
						<image src="@/static/img/wallet/icon-n.png" mode=""></image>
						<text class="sys-size-20 sys-color-white">立省35元</text>
					</view>
					<view :class="shopId===item.id?'sys-color-FE6915':'sys-color-gray-9'" class="sys-size-28 mt-60">50个</view>
					<view class="m-8">
						<text class="sys-size-24 sys-color-FE6915">￥</text>
						<text class="sys-size-48 sys-color-FE6915 sys-weight-600">9.9</text>
					</view>
					<view :class="shopId===item.id?'sys-color-FE6915':'sys-color-gray-9'" class="sys-size-28">2元/个</view>
				</view>
			</scroll-view>
		</view>
		
		<view class="info-b">
			<view class="card-button sys-background-41AAEE sys-size-32 sys-color-white" @click="to(2)">
				<image src="@/static/img/wallet/zfb-logo.png" mode="scaleToFill"></image>支付宝支付
			</view>
			<view class="card-button sys-background-6DCF06 sys-size-32 sys-color-white" @click="to(3)">
				<image src="@/static/img/wallet/wx-logo.png" mode="scaleToFill"></image>微信支付
			</view>
		</view>
		<view class="sys-size-24 sys-color-white info-1">会员特惠补充装，给你更多的动心</view>
		<view class="sys-size-22 sys-color-4BC285 info-1" @click="to(5)">《常见问题》</view>
	</view>
</template>

<script>
	export default {
		name:'small-paper',
		data(){
			return{
				shopId:2,
				list:[{id:1},{id:2},{id:1},{id:1},{id:1},{id:1},],
			}
		},
		mounted() {
			console.log('加载1');
		},
		methods:{
			to(type,item){
				if(type === 1){
					this.$emit('close')
				}else if(type === 4){
					// 选择
				}else if(type === 2){
					// 支付宝
				}else if(type === 3){
					// 微信
				}else if(type === 5){
					// 常见问题
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	.paper-index{
		width: 100%;
		height: 100vh;
		position: absolute;
		top: 0;
		left: 0;
		background: rgba(0,0,0,0.65);
		z-index: 100;
		padding: 148rpx 32rpx 0 32rpx;
		.mb-8{
			margin-bottom: 8rpx;
		}
		.mb-38{
			margin-bottom: 38rpx;
		}
		.mt-60{
			margin-top: 60rpx;
		}
		.m-8{
			margin: 8rpx 0;
		}
		.info-1{
			margin-bottom: 12rpx;
			text-align: center;
		}
		.info-b{
			display: flex;
			justify-content: space-between;
			.card-button{
				width: 333rpx;
				height: 88rpx;
				border-radius: 16rpx;
				line-height: 88rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				margin: 24rpx 0;
				image{
					width: 32rpx;
					height: 32rpx;
					margin-right: 8rpx;
				}
			}
		}
		.close-box{
			width: 48rpx;
			height: 48rpx;
			text-align: center;
			line-height: 48rpx;
			border-radius: 50%;
			margin-left: auto;
			margin-bottom: 24rpx;
		}
		.box-info{
			width: 100%;
			min-height: 950rpx;
			background: #F0B503;
			border-radius: 16rpx;
			padding: 44rpx 24rpx 24rpx 24rpx;
			text-align: center;
			.box-1{
				width: 485rpx;
				height: 485rpx;
				margin: 0 auto;
				position: relative;
				.box-2{
					position: absolute;
					bottom: 10rpx;
					left: 178rpx;
				}
				image{
					width: 485rpx;
					height: 485rpx;
				}
			}
		}
		.scroll-list-x{
			width: 100%;
			height: 324rpx;
			border-radius: 20rpx;
			padding: 40rpx 32rpx;
			display: flex;
			white-space: nowrap;
			.list-n{
				line-height: 324rpx;
			}
			.list-box{
				display: inline-block;
				width: 182rpx;
				height: 244rpx;
				border-radius: 20rpx;
				margin: 0rpx 8rpx;
				box-sizing: border-box;
				position: relative;
				.incon-s{
					width: 140rpx;
					height: 40rpx;
					position: absolute;
					left: -6rpx;
					top: 0;
					image{
						width: 100%;
						height: 100%;
					}
					text{
						position: absolute;
						top: 2rpx;
						left:14rpx;
					}
				}
			}
			.view-n{
				border: 2rpx solid #E0E0E0;
			}
			.view-s{
				border: 2rpx solid rgba(254, 215, 124, 1);
				background: linear-gradient(180deg, #FEFAEE 0%, rgba(255,247,221,0.94) 100%);
			}
		}
	}
</style>