<template>
	<view class="content">
		<view class="wechat-block">
			<view class="info">
				<image class="info-logo" src="@/static/logo.png"></image>
				<view class="info-text">
					<view class="title">抖火法律</view>
					<view class="subtitle">关注公众号『抖火综法』</view>
				</view>
			</view>
			<image class="code" :src="code" mode="widthFix"></image>
			<view class="text">使用微信扫码关注，获取最新订单动态</view>
		</view>
	</view>
</template>

<script>
	import { scan } from '@/apis/interfaces/public.js'
	export default {
		data() {
			return {
				code: ''
			}
		},
		created() {
			uni.showLoading({
				title: '获取二维码...',
				mask : true
			})
			scan().then(res => {
				let { code } = res;
				this.code = res.code;
				uni.hideLoading()
			}).catch(err => {
				uni.showToast({
					title: err.message,
					icon : 'none'
				})
			})
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		padding-bottom: 10vh;
		box-sizing: border-box;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.wechat-block{
		background: white;
		width: 80%;
		padding: 50rpx;
		box-sizing: border-box;
		border-radius: 20rpx;
		box-shadow: 0 0 5rpx 5rpx rgba(0, 0, 0, .02);
		text-align: center;
		.info{
			display: flex;
			align-items: center;
			margin-bottom: 50rpx;
			.info-logo{
				width: 88rpx;
				height: 88rpx;
				border-radius: 10rpx;
			}
			.info-text{
				width: calc(100% - 88rpx);
				text-align: left;
				padding-left: 30rpx;
				box-sizing: border-box;
				.title{
					font-weight: bold;
					font-size: 32rpx;
				}
				.subtitle{
					font-size: 28rpx;
					color: gray;
				}
			}
		}
		.code{
			width: 100%;
			vertical-align: top;
		}
		.text{
			text-align: center;
			font-size: 30rpx;
			color: gray;
			line-height: 90rpx;
		}
	}
</style>
