<template>
	<view class="mg-lr-24">
		<view class="white-bg-wrap">
			<view class="u-f u-f-jcfs u-f-aic">
				<view class="fw400 light-gray fs28 mg-right-14 vertical-text">适用门店</view>
				<view class="right u-f u-f-jcfs" style="flex: 1;">
					<view class="mg-right-12">
						<image style="width: 134rpx;height: 134rpx;" :mode="'widthFix'" :src="goodsInfo.storeLogo">
						</image>
					</view>
					<view style="flex: 1;">
						<view class="u-f u-f-jcsb u-f-aic mg-bot-10">
							<view class="fs28 fw400 light-black">{{goodsInfo.storeName}}</view>
							<view class="u-f u-f-jcfs u-f-aic">
								<text style="margin-left: auto;"
									class="fs24 fw400 light-gray mg-right-18 mg-left-20">{{goodsInfo.storeNum}}家门店</text>
								<text class="big-gray-right-arrow"></text>
							</view>
						</view>
						<view class="mg-bot-10">
							<text class="fs28 light-gray fw400">{{goodsInfo.distance}}km</text>
						</view>
						<view class="u-f u-f-jcsb u-f-aic">
							<text class="fs28 fw400 light-gray">{{goodsInfo.detailedAddress}}</text>
							<text class="send-icon"></text>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<div class="goodsInfoBox">
			<image class="goodsInfoBoxImage" :src="goodsInfo.goodsImage" mode=""></image>
			<div class="goodsInfo">
				<div class="name">
					{{goodsInfo.goodsName}}
				</div>
				<div class="spce">
					{{goodsInfo.goodsSpecification}}
				</div>
				
				<div class="priceBox">
					<div class="price">
						{{goodsInfo.unitPrice}}
					</div>
					<div class="num">
						×{{goodsInfo.goodsNum}}
					</div>
				</div>
			</div>
		</div>

		<view class="white-bg-wrap mg-top-20" style="padding-top: 16rpx;">
			<view class="u-f u-f-aic u-f-jcsb light-black fs28 fw400 mg-bot-40">
				<text>现价</text>
				<text>￥{{goodsInfo.orderAmount}}</text>
			</view>
			<!-- <view class="u-f u-f-jcsb light-black fs28 fw400 mg-bot-42" @click="handleShowGoodQuan">
				<view>优惠券</view>
				<view class="u-f u-f-jcfs u-f-aic">
					<text>满减券</text>
					<text class="main-color mg-right-10"> ￥5</text>
					<text class="small-gray-right-arrow"></text>
				</view>
			</view>
			<view class="u-f u-f-jcfe u-f-aic fs24">
				<view class="light-black mg-right-10">已优惠</view>
				<view class="main-color mg-right-20">￥5</view>
				<view class="light-black">合计</view>
				<view class="mg-right-6">
					<text class="fs24">￥</text>
					<text class="fw700 fs32">694</text>
				</view>
			</view> -->
		</view>

		<view class="white-bg-wrap u-f u-f-jcsb u-f-aic" @click="enterMyGarage">
			<view class="u-f u-f-fdc mg-right-64" style="flex: 3">
				<view class="u-f u-f-jcsb">
					<view class="u-f u-f-jcfs u-f-aic">
						<image :src="goodsInfo.brandLogo" style="width: 56rpx;height: 56rpx;"
							:mode="'widthFix'" class="mg-right-10"></image>
						<text class="fw400 fs30 light-black">{{goodsInfo.vehicleBrand}}{{goodsInfo.vehicleModel}}</text>
					</view>
					<view class="u-f u-f-aifs u-f-jcfs">
						<text class="province">{{goodsInfo.plateNo?goodsInfo.plateNo[0]:''}}</text>
						<text class="car-num">{{goodsInfo.plateNo?goodsInfo.plateNo.slice(1):''}}</text>
					</view>
				</view>
				<view class="fs24 light-gray mg-top-14">{{goodsInfo.vehicleConfig}}</view>
			</view>
			<view class="u-f u-f-jcfs u-f-aic">
				<text class="gray-right-arrow"></text>
			</view>
		</view>

		<view class="mg-top-20 white-bg-wrap u-f u-f-jcsb u-f-aic fs28 light-black">
			<view>支付方式</view>
			<view class="u-f u-f-jcfs" style="margin-top: 40rpx;margin-bottom: 40rpx;">
				<text class="wx-apply mg-right-6"></text>
				<text>微信支付</text>
			</view>
		</view>

		<view class="fix-bot">
			<view class="content u-f u-f-jcsb u-f-aic">
				<!-- <view class="fs24 light-gray fw400 u-f u-f-jcfs">
					<view class="light-black mg-right-10">总优惠</view>
					<view class="main-color mg-right-20">￥5</view>
				</view> -->
				<view>
					<view class="u-f u-f-aic u-f-fdc">
						<view class="u-f u-f-aic u-f-jcfs">
							<text class="fs24 light-black mg-right-6">实付</text>
							<view class="main-color">
								<text class="fs24">￥</text>
								<text class="fs32">{{goodsInfo.orderAmount}}</text>
							</view>
						</view>
					</view>
				</view>
				<view class="line-gradient-btn" @click="handlePay">
					立即支付
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	var app = getApp()
	import commonTitle from "../.././components/common-title/common-title.vue"
	import uniPopup from "../../components/uni-popup/uni-popup.vue"
	export default {
		components: {
			commonTitle,
			uniPopup
		},
		data() {
			return {
				goodsInfo: {},
				show: false,
				item: {
					goodTitle: "【国庆特惠】264元团300元【国庆特惠】264元团300元【国庆特惠】264元团300元",
					desc: "205/55R16",
					price: "￥264",
					oldPrice: "￥300"
				}
			}
		},

		onLoad(options) {
			this.goodsInfo = JSON.parse(decodeURIComponent(options.data))
			console.log(this.goodsInfo);
		},

		onShow() {
			console.log(app);
		},

		methods: {
			handlePay() {
				uni.redirectTo({
					url: "/pages/pay-success/pay-success"
				})
			},
			enterMyGarage() {
				uni.navigateTo({
					url: "/pages/my-garage/my-garage"
				})
			},
			handleShowGoodQuan() {
				console.log("handleShowGoodQuan")
				this.show = true;
			},
			handleHideGoodQuan() {
				this.show = false;
			}
		}
	}
</script>

<style>
	page {
		background-color: #F9F9F9;
	}
</style>

<style lang="scss" scoped>
	.gray-down-arrow {
		width: 16rpx;
		height: 16rpx;
		background: url(../.././static/shop/bot-arrow.png) no-repeat center center;
		background-size: 100%;
	}

	.gray-right-arrow {
		width: 16rpx;
		height: 16rpx;
		// background: url(../.././static/right-arrow.png) no-repeat center center;
		background-size: 100%;
	}

	.check {
		width: 36rpx;
		height: 36rpx;
		background-color: red;
		// background: url(../.././static/common/check.png) no-repeat center center;
		background-size: 80%;
	}

	.province {
		padding: 12rpx 20rpx;
		color: #ffffff;
		background-color: #20CF55;
		border-radius: 8rpx 0rpx 0rpx 8rpx;
		border: 1rpx solid #0087EF;
	}

	.car-num {
		padding: 12rpx 20rpx;
		color: #20CF55;
		background: #E5EEF5;
		border-radius: 0 8rpx 8rpx 0;
		border: 1rpx solid #20CF55;
	}

	.fix-bot {
		width: 100%;
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 333;

		.content {
			background-color: #ffffff;
			padding: 10rpx 24rpx;
		}
	}

	.line-gradient-btn {
		background: linear-gradient(90deg, #FF4502 0%, #FF8903 100%);
		border-radius: 41rpx 41rpx 41rpx 41rpx;
		text-align: center;
		padding: 22rpx 120rpx;
		color: #ffffff;
	}

	.wx-apply {
		width: 44rpx;
		height: 44rpx;
		background: url(../.././static/common/wx_pay.png) no-repeat center center;
		background-size: 100%;
	}

	.small-gray-right-arrow {
		width: 16rpx;
		height: 16rpx;
		// background: url(../.././static/common/gray_right_arrow.png) no-repeat center center;
		background-size: 100%;
	}

	.share-modal {
		position: relative;
		padding: 24rpx;

		.gray-close {
			position: absolute;
			right: 28rpx;
			top: 28rpx;
			width: 42rpx;
			height: 42rpx;
			// background: url(../.././static/common/gray-close.png) no-repeat center center;
			background-size: 100%;
		}

		.content-wrap {
			width: 100%;

			.inner {
				padding: 12rpx;
				border-radius: 10rpx;
				background-color: #ffffff;
				border: 10rpx solid #FF4502;
			}
		}
	}
	
	.goodsInfoBox{
		margin-top: 20rpx;
		padding: 20rpx;
		width: 702rpx;
		height: 178rpx;
		background: #FFFFFF;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		
		.goodsInfoBoxImage{
			width: 128rpx;
			height: 128rpx;
			background: #FFFFFF;
			border-radius: 9rpx 9rpx 9rpx 9rpx;
			margin-right: 10rpx;
		}
		
		.goodsInfo{
			flex: 1;
			.name{
				font-size: 28rpx;
				color: #333333;
				margin-bottom: 10rpx;
			}
			
			.spce{
				font-size: 24rpx;
				color: #999999;
				margin-bottom: 10rpx;
			}
			
			.priceBox{
				display: flex;
				align-items: center;
				justify-content: space-between;
				
				.price{
					font-weight: bold;
					font-size: 32rpx;
					color: #FF4502;
				}
				
				.num{
					font-size: 24rpx;
					color: #999999;
				}
			}
		}
	}
</style>