<template>
	<view class="kaihuiLink">
		<view class="imgBox" @click="handleBtn">
			<image
				src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/hYSp4iUadCmd423d83bffdb8bb80607cfcac5ff64a0c.jpg/1.jpg"
				mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	import {
		qrcode
	} from '@/api/common.js';
	export default {
		data() {
			return {
				showWeb: false,
				src: '',
				test: ''
			}
		},
		methods: {
			handleBtn() {
				if (uni.getStorageSync('token')) {
					if (JSON.parse(uni.getStorageSync('userInfo')).setMealCode != 0 && JSON.parse(uni.getStorageSync(
							'userInfo')).setMealCode) {
						uni.navigateToMiniProgram({
							appId: 'wx57a08b407511613d',
							path: '//凯辉/首页/YWUe2IrfXEryMkw'
						})
					} else {
						uni.showModal({
							title: '此权益需要开通会员才可使用',
							cancelText: '下次再说',
							confirmText: '立即开通',
							success(res) {
								if (res.confirm) {
									uni.navigateTo({
										url: '/my/memberCenter/index'
									})
								}
							}
						})
					}

				} else {
					return uni.showModal({
						title: '请登录',
						confirmText: '去登录',
						success(res) {
							if (res.confirm) {
								uni.navigateTo({
									url: '/login/login/login?redirect=/special/kaihui'
								})
							}
						}
					})
				}

			},
			loadedPage() {
				uni.hideLoading()
			},
			onmessage(val) {
				console.log(val);
			}
		},
		created() {},
	}
</script>

<style lang="scss" scoped>
	.kaihuiLink {
		.imgBox {
			&>image {
				width: 100vw;
				height: 100vh;
				object-fit: cover;
				position: fixed;
				top: 0;
				left: 0;
				z-index: -1;
			}
		}
	}
</style>