<template>
	<view class="content vflex acenter jcenter">
		<view class="box">
			<view class="title">正在跳转忆象淘宝官方旗舰店</view>
			<view class="text">欢迎联系店面客服</view>
			<image :src="img" mode="aspectFill"></image>
		</view>
		<view class="btn" @click="jump">继续跳转</view>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	export default {
		data() {
			return {
				img: 'https://dummyimage.com/279x155/e3e3e3/fff',
				src: ''
			}
		},
		onLoad() {
			this.getdata()
		},
		methods: {
			getdata() {
				var that = this
				$api.req({
					url: 'config',
					data: {
						module: 'shop'
					}
				}, function(res) {
					if(res.data.shop_images.length > 0) {
						that.img = res.data.shop_images[0]	
					}
					that.src = res.data.shop_url
					console.log(res);
				})
			},
			jump() {
				uni.navigateTo({
					url: '/pages/webview/index?url=' + this.src
				})
				// if (plus.os.name == 'Android') {
				// 	plus.runtime.launchApplication({
				// 		pname: 'com.taobao.taobao',
				// 	}, function(e) {
				// 		uni.showModal({
				// 			content: '本机未检测到淘宝客户端，请先下载淘宝APP',
				// 			success: function(res) {

				// 			}
				// 		})
				// 	});
				// } else if (plus.os.name == 'iOS') {
				// 	plus.runtime.launchApplication({
				// 		action: 'taobao://',
				// 	}, function(e) {
				// 		uni.showModal({
				// 			content: '本机未检测到淘宝客户端，请先下载淘宝APP',
				// 			success: function(res) {

				// 			}
				// 		})
				// 	})
				// }

			}
		}
	}
</script>

<style lang="scss">
	.content {
		background: #F5F5F5;
		height: 100vh;

		.box {
			background: #FFFFFF;
			border-radius: 20rpx;
			box-sizing: border-box;
			padding: 40rpx;

			.title {
				font-size: 32rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 600;
				color: #333333;
			}

			.text {
				font-size: 28rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #999999;
				padding: 24rpx 0 76rpx;
			}

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

		.btn {
			width: 662rpx;
			height: 88rpx;
			background: #00B0B0;
			border-radius: 12rpx;
			margin: 90rpx 0 0;
			font-size: 32rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
			line-height: 88rpx;
			text-align: center;
		}
	}
</style>