<template>
	<view class="Box flex-between">
		<view class="content flex-colum" @click="indexInvoicing" v-if="improveinformation">
			<image src="@/static/item3.png" mode="aspectFill"></image>
			<text>自开票</text>
		</view>
		<view class="content flex-colum" @click="webview" v-if="improveinformation">
			<image src="@/static/item2.png" mode="aspectFill"></image>
			<text>开票员管理</text>
		</view>
		<view class="content flex-colum" @click="indexorder" v-if="improveinformation">
			<image src="@/static/item1.png" mode="aspectFill"></image>
			<text>开票记录</text>
		</view>
		<!-- <view class="content flex-colum" @click="information">
			<image src="@/static/item4.png" mode="aspectFill"></image>
			<text>完善商家信息</text>
		</view> -->
		<view class="content flex-colum" @click="notification" v-if="improveinformation">
			<image src="@/static/item6.png" mode="aspectFill"></image>
			<text>绑定通知</text>
		</view>
	</view>
</template>
<script>
	export default {
		components: {},
		data() {
			return {
				improveinformation: false,
				improveinformationlist: {}
			};
		},
		onLoad(e) {
			// getLocationInfo() {
			// 		uni.getLocation({
			// 			type: 'wgs84',
			// 			success: (res) => {
			// 				console.log(res, '获取距离')
			// 				// this.lng = res.longitude
			// 				// this.lat = res.latitude
			// 				// this.positionindex()
			// 			},
			// 			fail: (err) => {
			// 				// this.positionindex()
			// 				console.log(err, '获取错误')
			// 			}
			// 		});
			// 	},
			if (e.userId) {
				uni.cache.set('userId', e.userId);
			}
			uni.request({
				url: uni.conf.baseUrl + 'store/storestatus',
				data: {
					//参数
					store_id: uni.getStorageSync('userId')
				},
				method: 'POST', //请求方式，必须为大写
				success: res => {
					this.improveinformationform = res.data.data.store
					uni.cache.set('form', this.improveinformationform);
					if (res.data.data.sz_status == 0) {
						uni.reLaunch({
							url: '/pages/index/information'
						});
						// uni.redirectTo({
						// 	url: '/pages/index/information?store=' + JSON.stringify(this.improveinformationform)
						// });
					} else {
						this.improveinformation = true
					}
				},

			});
		},
		onShow() {},
		methods: {
			information() {
				uni.pro.navigateTo('index/information', this.improveinformationform);
			},
			notification() {
				uni.pro.navigateTo('index/notification');
			},
			indexInvoicing() {
				uni.pro.navigateTo('index/Invoicing');
			},
			webview() {
				uni.pro.showLoading({
					title: '加载中',
					mask: true
				})
				try {
					uni.request({
						url: uni.conf.baseUrl + 'szzpy/h5url',
						data: {
							//参数
							store_id: uni.getStorageSync('userId')
						},
						method: 'POST', //请求方式，必须为大写
						success: res => {
							console.log(res.data.data.url)
							uni.pro.navigateTo('webview/webview', {
								url: res.data.data.url,
								tape: 1
							});
							uni.pro.hideLoading()
						}
					});
				} catch (e) {
					uni.pro.hideLoading()
				}

			},
			indexorder() {
				uni.pro.navigateTo('index/order');
			}
		}
	};
</script>

<style lang="scss">
	page {
		background: #F9F9F9;
	}

	.Box {
		padding: 0rpx 28rpx;

		.content {
			margin-top: 32rpx;
			width: 218rpx;
			height: 218rpx;
			background: #FFFFFF;

			image {
				width: 60rpx;
				height: 60rpx;
			}

			text {
				margin-top: 16rpx;
				font-family: Source Han Sans CN, Source Han Sans CN;
				font-weight: 400;
				font-size: 28rpx;
				color: #333333;
			}
		}

	}

	.Box::after {
		content: '';
		width: 218rpx;
		display: inline-block;
	}
</style>