<template>
	<view class="manager">

		<view class="flex-row justify-center">
			<view class="grid">
				<view class="flex-col gridItem" @click="navigateToPage('/pages/specialistsList/specialistsList')">
					<view  class="title flex-row justify-center">
						<text>累计专员数量</text>
					</view>
					<view class="number flex-row justify-center">
						<text>2008</text>
					</view>
				</view>
				<view class="flex-col gridItem leftBorder" @click="navigateToPage('/pages/todaySpecialistsList/todaySpecialistsList')">
					<view  class="title flex-row justify-center">
						<text>今日新增专员</text>
					</view>
					<view class="number flex-row justify-center">
						<text>2008</text>
					</view>
				</view>
				<view class="flex-col gridItem leftBorder">
					<view  class="title flex-row justify-center">
						<text>本月任务</text>
					</view>
					<view class="number flex-row justify-center">
						<text>20/800</text>
					</view>
				</view>
				<view class="flex-col gridItem">
					<view  class="title flex-row justify-center">
						<text>累计异业伙伴</text>
					</view>
					<view class="number flex-row justify-center">
						<text>2008</text>
					</view>
				</view>
				<view class="flex-col gridItem leftBorder">
					<view  class="title flex-row justify-center">
						<text>累计卖券金额</text>
					</view>
					<view class="number flex-row justify-center">
						<text>2008</text>
					</view>
				</view>
			</view>
		</view>

		<view class="flex-row justify-center">
			<view class="qrView" @click="qrCodePopup">
				<uv-qrcode ref="qrcode" size="600rpx" :value="qrcodeUrl" :options="options"></uv-qrcode>
			</view>
		</view>

		<uni-popup ref="createQrCodePopup" type="center">
			<view class="createQrCodePopup flex-col justify-center">
				<view class="flex-row justify-center">
					<uv-qrcode ref="qrcode" size="600rpx" :value="qrcodeUrl" :options="options"></uv-qrcode>
				</view>
				<view class="xoIcon" @click="closePopup">
					<u-icon name="close-circle" color="#666" size="35"></u-icon>
				</view>
			</view>
		</uni-popup>

	</view>
</template>

<script>
	import commonUtils from "../../../common/js/utils/commonUtils";

	export default {
		props: {
			height: {
				type: String,
				default () {
					return ''
				}
			},
		},
		data() {
			return {
				qrcodeUrl:this.$xcxUrl+'?expandUserId={expandUserId}&ruleId={ruleId}&timestamp={timestamp}&type=2&expand1=2',
				options: {
					// 指定二维码前景，一般可在中间放logo
					foregroundImagePadding:2,
					foregroundImageBorderRadius:5,
					foregroundImageSrc: '/static/logo.png'
				},
			}
		},
		created() {
			console.log('接收到的高度', this.height)
			this.userInfo = uni.getStorageSync('spreadUserInfo')
		},
		methods: {
			formatDate() {
				this.qrCreateTime = commonUtils.formatDate(new Date())
			},
			qrCodePopup(){
				this.$refs.createQrCodePopup.open()
			},
			closePopup(){
				this.$refs.createQrCodePopup.close()
			},

			navigateToPage(url){
				uni.navigateTo({
					url:url
				})
			},

		}
	}
</script>

<style scoped lang="scss">
	@import './index.rpx.css';
</style>
