<template>
	<view class="page-fill">
		<view class="successicon">
			<image class="imageIcon" src="../../static/orderInfo/orderinfo-success.png" mode=""></image>
		</view>
		<text class="paystatus">支付成功</text>
		<text class="payinfo">
			{{mycarNumber}} ￥{{payMoney|priceFormat()}}
		</text>
		<text class="paytime">
			支付时间：{{dateStr}}
		</text>
		<view style="background: #d9d9d9;height:1px;margin-top:7px ;margin-left:15px ;opacity:  0.5; padding:0px;overflow:hidden;"></view>

		<text class="payways">
			支付方式：{{payWays}}
		</text>
		<view style="background: #d9d9d9;height:1px;margin-top:7px;margin-left:15px ;opacity: 0.5;padding:0px;overflow:hidden;"></view>
		
		<text v-if="appOrderTimeout !=''"  class="payways">
			温馨提示：{{appOrderTimeout}}
		</text>
		<view v-if="appOrderTimeout !=''"   style="background: #d9d9d9;height:1px;margin-top:7px;margin-left:15px ;opacity: 0.5;padding:0px;overflow:hidden;"></view>
		
		<button @click="Click" class="button-sp-area" type="primary" plain="true">完成</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mycarNumber:'',
				payWays:'',
				payMoney:0,
				appOrderTimeout:'',
				dateStr:''
			}
		},

		onLoad(params) {
			wx.showShareMenu({
				withShareTicket: true
			})
			this.mycarNumber = params.carNumber;

			this.payWays = params.payWays;
			this.payMoney = params.payMoney;
			this.appOrderTimeout = params.appOrderTimeout; 
			this.getNowDate();
		},
		methods: {
			Click() {
				uni.navigateTo({
					url: '../index/idnex'
				
				});
			},
			getNowDate(){
				var dateTime = new Date();
				this.dateStr = this.getDateWeek(dateTime);
				
			},
			
		getDateWeek(now) {
			// var now=new Date();
			var year = now.getFullYear(); //获取四位数年数
			var month = now.getMonth() + 1;
			var date = now.getDate();
			var weeknum = now.getDay();

			var s = year + '-' + this.Appendzero(month) + '-' + this.Appendzero(date);
			return s;
		},
		Appendzero(obj) {
			if (obj < 10) return '0' + '' + obj;
			else return obj;
		}
		}
	}
</script>

<style>
	.page-fill {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
	}

	.imageIcon {
		width: 96px;
		height: 95px;
		margin-top: 42px;
		margin-left: auto;
		margin-right: auto;
		/* margin: 42px auto; */
		display: flex;
		justify-content: center;


	}

	.paystatus {
		margin-top: 20px;
		font-weight: bold;
		font-size: 18px;
		color: #404040;
		display: flex;
		justify-content: center;
	}

	.payinfo {
		margin-top: 3px;
		font-size: 16px;
		color: #404040;
		display: flex;
		justify-content: center;
	}

	.paytime {
		margin-top: 51px;
		margin-left: 15px;
		font-size: 14px;
		color: #404040;
		display: flex;
		justify-content: flex-start;
	}

	.payways {
		margin-top: 17px;
		margin-left: 15px;
		font-size: 14px;
		color: #404040;
		display: flex;
		justify-content: flex-start;
	}

	.button-sp-area {
		margin: 0 auto;
		width: 60%;
		margin-top: 114px;

	}
</style>
