<template>
	<view class="kaihuiLink">
		<view class="imgBox">
			<image src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/g4F5r34OhLD99e4277ef0139b36812fdd75a8d3b4aad.png/1.png" mode="widthFix"></image>
		</view>
		<view class="btn">
			<view class="kaihuiBtn" @click="handleBtn">立即下单</view>
		</view>
		<view class="kaihuiRule">
			<view class="title">
				<image src="../static/kaihuifuli.png" mode="widthFix"></image>
			</view>
			<view class="text">*仅限本平台会员中国移动用户专享</view>
		</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/water'
								})
							}
						}
					})
				}
				
			},
			loadedPage(){
				uni.hideLoading()
			},
			onmessage(val){
				console.log(val);
			}
		},
		 created() {},
	}
</script>

<style lang="scss" scoped>
	.kaihuiLink {
		.imgBox {
			&>image {
				width: 100%;
			}
		}

		.btn {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			position: relative;

			.kaihuiBtn {
				position: absolute;
				width: 360rpx;
				height: 80rpx;
				border-radius: 40rpx;
				background-color: #EE4320;
				color: white;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 32rpx;
				font-weight: bold;
			}
		}

		.kaihuiRule {
			margin-top: 60rpx;
			width: 100%;
			position: relative;
			.title{
				position: absolute;
				left:200rpx;
				&>image{
					width: 350rpx;
				}
			}
			.text{
				position: absolute;
				top: 40rpx;
				font-size: 24rpx;
				margin-top: 20rpx;
				margin-left: 20rpx;
			}
		}
	}
</style>