<template>
	<view class="Body">
		<image src="/static/login/logo1.png" mode=""></image>
		<button type="primary" @click="goBack()">返回宜格服务APP</button>
		<!-- <a href="ygfwUrlSchemes://">返回宜格服务APP</a> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderNo: "",
				error: {}
			}
		},
		onLoad(options) {
			if (options.orderNo) {
				this.orderNo = options.orderNo
			} else {
				uni.showToast({
					icon: "none",
					title: "参数缺失!",
					duration: 2000
				});
			}
		},
		methods: {
			goBack() {
				this.isIos = uni.getSystemInfoSync().platform //判断是否安卓、ios
				if (this.isIos == 'android') {
					// let ifr = document.createElement("iframe");
					// ifr.src =
					// "ygfwUrlSchemes://"; // 这里的hbuilder在manifest.json中配置->“App常用其它设置” -> “Android设置” -> “UrlSchemes” 项中进行设置
					// ifr.style.display = "none";
					// document.body.appendChild(ifr);
					window.location = "ygfwUrlSchemes://&orderNo=" + this.orderNo;
				} else {
					window.location = "https://yigeapp.songlanyun.com"
					// window.open("https://apps.apple.com/cn/app/nano-health/id1615496457");
					// window.location="https://appstore.nanomirai.com"
					// window.location = "https://yigeapp.songlanyun.com/ygfw/" //你的苹果应用app链接 
					// plus.runtime.launchApplication({
					// 	action: "ygfy://?callback=interapp-callback=123&merchantKey=SG23323424EXS3"
					// }, function(e) {
					// 	uni.showToast({
					// 		icon: "none",
					// 		title: e.message
					// 	})
					// 	console.log("Open system default browser failed: " + e.message)
					// });
				}

				// window.location ="ygfwUrlSchemes://";
				// this.error='aaa'
			},

		}
	}
</script>

<style lang="scss" scoped>
	.Body {
		padding-top: 300rpx;
		text-align: center;

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


		button {
			width: 80%;
			margin: 200rpx auto 0;
			// background: rgb(107,228,247);
		}
	}
</style>