<template>
	<view class="box">
    <wx-points-commit ref='wxPointsCommit'></wx-points-commit>

		<image :src="custTypeId === 0 ? './static/images/icon1.png' : `${picUrl}parkingFee/icon-car-${colorAry[custTypeId - 1]}.png`" v-if="custTypeId >= 0"/>
		<view>{{carno | formatCarno}}<br/>{{msg}}</view>
		<uni-button type="primary" :class="{'searchPrice': true, 'blueSearchPrice': custTypeId === 1, 'greenSearchPrice': custTypeId === 2}" @click="search">重新查询</uni-button>
	</view>
</template>

<script>
	import { mapState } from 'vuex'
	const app = getApp();
	export default {
		onLoad(params) {
			this.msg = params.msg;
			this.carno = params.carno;
		},
		data() {
			return {
				msg: '',
				carno: '',
				picUrl: this.$picUrl,
				colorAry: ['blue', 'green']
			}
		},
		computed: {
			...mapState({
				custTypeId: state => state.custTypeId
			})
		},
		methods: {
			search() {
				uni.navigateBack();
				// const params = {
				// 	carno: this.carno,
				// 	mallid: app.globalData.mallid,
				// 	openid: app.globalData.openId,
				// 	vipcode: app.globalData.member.vipcode,
        //   groupId: app.globalData.groupId,
        //   createuser: "sys_miniprogram",
				// }
				// this.$md(params)
				// uni.request({
				// 	url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
				// 	data: params,
				// 	method: 'POST',
				// 	header: JSON.parse(uni.getStorageSync('handleUser')),
				// 	success: (res) => {
				// 		uni.hideLoading();
				// 		if (res.data.code === 0) {
				// 			uni.navigateTo({
				// 				url: './parkingFeeDetail?carno=' + this.carno
				// 			})
				// 		}
				// 	}
				// });
			}
		}
	}
</script>

<style lang="less" scoped>
	@import '../../styles/common.less';
.box {
	text-align: center;
	image {
		width: 200rpx;
		height: 200rpx;
		margin-top: 200rpx;
	}
	view {
		margin-top: 20rpx;
	}
	.searchPrice {
		color: #fff !important;
		margin: 0 auto;
		margin-top: 40rpx;
		height: 90rpx;
		width: 80%;
		line-height: 90rpx;
		border-radius: 80rpx;
		font-size: 17px;
		background-image: linear-gradient(to right, #7e4fa1 , #433c7f);
	}
	.blueSearchPrice {
		.colorSearchPrice('blue');
	}
	.greenSearchPrice {
		.colorSearchPrice('green');
	}
	.colorSearchPrice(@value) {
		@color: 'color-@{value}';
		background-image: none;
		background-color: @@color;
	}
}
</style>
