<template>
	<view>
		<view class="main">
			<view>
				<image :src="tipdata[0]"></image>
			</view>
			<view class="tip">{{tipdata[1]}}</view>
			<view class="descript">{{tipdata[2]}}</view>
			<view v-if="tipInfo!='Inside'"><button type="primary" @click="goHome" class="index">{{tipdata[3]}}</button></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['tipInfo'],
		data() {
			return {
				tipType: '', //提示类型:(完成:over;未插枪:nogun;失败:fail)
			}
		},
		methods: {
			goHome() {
				if (this.tipInfo == 'over') {
					this.$utils.navigateTo("ucenter/charge");
				} else {
					this.$utils.switchTab("index/index");
				}

			}
		},
		// onShow() {
		// 	this.tipType=this.tipInfo
		// },
		computed: {
			tipdata() {
				switch (this.tipInfo) {
					case 'nogun':
						return ['https://rl-zk-image.oss-cn-hangzhou.aliyuncs.com/vehicle-pic/2023-06/86f1f2c5447b44d28926f4d175671bad-uploadFile',
							'未插枪', '检测到插枪未连接车辆，请连接后重试！', '返回首页', '异常提示'
						]
					case 'over':
						return ['https://rl-zk-image.oss-cn-hangzhou.aliyuncs.com/vehicle-pic/2023-06/110773ed753d4750aaba05834e2ea09e-uploadFile',
							'充电完成', '您可以在【我的】充电记录中查看对应充电信息', '查看充电记录', '充电完成'
						]
					case 'fail':
						return ['https://rl-zk-image.oss-cn-hangzhou.aliyuncs.com/vehicle-pic/2023-06/dfc15b9438624ded97bee786d915a4f7-uploadFile',
							'充电失败', '启动充电失败，请联系站点处理！', '返回首页', '充电失败'
						]
					case 'Inside':
						return ['https://rl-zk-image.oss-cn-hangzhou.aliyuncs.com/vehicle-pic/2023-06/dfc15b9438624ded97bee786d915a4f7-uploadFile',
							'该枪未切换站外充电', '请联系站内值守人员！', '返回首页', '提示信息'
						]
				}
			}
		},
		onLoad(options) {
			// this.ErrorTip = options.error
			uni.setNavigationBarTitle({
				title: this.tipdata[4]
			})
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		width: 588rpx;
		display: flex;
		flex-direction: column;
		margin: 0 auto;
		text-align: center;
		font-size: 32rpx;
		color: #1D2129;
		padding-top: 100rpx;

		image {
			width: 547rpx;
			height: 511rpx;
		}

		.tip {
			margin-bottom: 24rpx;
			font-size: 36rpx;
			font-weight: 600;
			color: #1D2129;
		}

		.descript {
			font-weight: 400;
			color: #88909B;
			font-size: 28rpx;
			margin-bottom: 98rpx;
		}

		.index {
			width: 400rpx;
			height: 88rpx;
			background: #58BE6B;
			border-radius: 58rpx 58rpx 58rpx 58rpx;
			opacity: 1;
			font-size: 32rpx;
			color: #fff;
			font-weight: 600;
			line-height: 88rpx;
			font-family: Noto Sans SC-Regular, Noto Sans SC;
		}
	}
</style>