<template>
	<view class="page">
		<view class="qrcode">
			<text class="title">长按扫码添加枝点小助手</text>
			<text class="title margin-bottom">立即入驻</text>
			<image :src="qrcode" class="img" show-menu-by-longpress @longpress="handleAdd"></image>
		</view>
	</view>
</template>

<script>
	import {
		getCustomerServiceQRCode
	} from '@/api/platform.js'
	export default {
		data() {
			return {
				qrcode: ''
			};
		},
		onLoad() {
			getCustomerServiceQRCode().then(res => {
				console.log(res)
				this.qrcode = res.data.url
			})
		},
		methods: {
			handleAdd() {
				// uni.previewImage({
				// 	urls: [this.qrcode]
				// })
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		width: 100%;
		height: 100vh;
		background: #FFF;
		display: flex;
		justify-content: center;
		align-items: center;

		.qrcode {
			width: 100%;
			margin: 0 32rpx;
			height: 600rpx;
			background: #fff;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			.title {
				font-size: 32rpx;
				font-weight: 500;
				text-align: center;
				color: #0B0E26;
			}

			.img {
				width: 300rpx;
				height: 300rpx;
			}
		}
	}
</style>