<template>
	<u-popup :show="payShow" @close="payShow=false">
		<view class="details_pay">
			<view class="title">
				<text>请选择</text>
				<image :src="imgBase+'remind_close.png'" @tap="cancelPay"></image>
			</view>
			<view class="wechat_pay">
				<view class="wp_left">
					<image :src="imgBase+'img_pay.jpg'"></image>
					<text>微信支付</text>
				</view>
					<image :src="imgBase+'selected.png'"></image>
			</view>
			<view class="zt_btn" @tap="confirmPay">确定</view>
		</view>
	</u-popup>
</template>

<script>
	export default {
		options: {
			styleIsolation: 'shared' //样式分离，使组件/deep/下的样式生效
		},
		data() {
			return {
				payShow: false
			}
		},
		methods: {
			cancelPay(){
				uni.showModal({
					title:'温馨提示',
					content:'您的订单尚未完成支付，确定要离开？',
					success: (res) => {
						if(res.confirm){
							this.payShow = false;
							this.$emit('cancelPay');
						}
					}
				})
			},
			confirmPay() {
				this.$emit('confirmPay');
			}
		}
	}
</script>

<style lang="less">
	/deep/.u-popup__content {
		border-radius: 32rpx 32rpx 0 0;
	}

	.details_pay {
		padding: 40rpx 30rpx 55rpx;
		min-height: 400rpx;
		border-radius: 32rpx 32rpx 0 0;
		background: #F6F6F6;

		.title {
			position: relative;
			text-align: center;

			text {
				font-size: 36rpx;
				font-family: PingFang-SC-Bold, PingFang-SC;
				font-weight: bold;
				color: #333333;
			}

			image {
				width: 36rpx;
				height: 36rpx;
				position: absolute;
				right: 10rpx;
				top: 50%;
				margin-top: -18rpx;
			}
		}

		.wechat_pay {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 83rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 0rpx 0rpx;
			padding: 41rpx 24rpx;

			.wp_left {
				display: flex;
				align-items: center;

				image {
					width: 54rpx;
					height: 54rpx;
				}

				text {
					font-size: 32rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
					margin-left: 24rpx;
				}
			}

			&>image {
				width: 48rpx;
				height: 48rpx;
			}
		}

		.zt_btn {
			margin-top: 59rpx;
		}
	}
</style>