<template>
	<view style="padding-top: 30rpx;">
		<view v-if="showScan" class="scanBox" @click="getCode">
			<image src="../../static/fangwei/icon.png" mode="widthFix" style="width: 140rpx;"></image>
			<view class="scanBox_middle">
				<text class="title">扫码发货</text>
				<!-- <text>通过扫码发货可以更改产品防伪码上的客户信息</text> -->
				<text>给客户发货之前，先扫描每套货上的二维码（防伪码），这样客户收到货之后二维码上就是客户的信息。</text>
				<!-- <text>简单·快捷·一键发货</text> -->
			</view>
			<image src="../../static/new_stock/arrow.png" mode="widthFix" style="width:48rpx;"></image>
		</view>
		<view v-else class="tipd">
			<image src="../../static/default/no_record.png" mode="widthFix" style="width: 70%;"></image>
			<view class="title">
				抱歉,您没有权限访问
			</view>
		</view>
		<view v-if="showScan" class="hint_box flexC" @click="howSend">
			<image src="../../static/icon/query.png"></image>
			<text>如何扫码发货</text>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				showScan: false,
				data: []
			}
		},
		onLoad(ops) {

		},
		onShow() {
			const userInfo = this.$store.state.userinfo
			if (userInfo.user_type == 3) {
				this.showScan = true
			} else {
				this.showScan = false
			}
		},
		methods: {
			getCode() {
				uni.navigateTo({
					url: './belong'
				})
			},
			//跳转到如何扫码发货
			howSend() {
				uni.navigateTo({
					url: '../howSend/howSend'
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	page {
		background-color: #fff;
	}

	.tipd {
		width: 100%;
		height: 400rpx;
		position: absolute;
		top: 20%;
		justify-content: center;
		display: flex;
		align-items: center;
		flex-direction: column;

		.title {
			margin-top: 25rpx;
			font-size: 30rpx;
			font-weight: bold;
			color: #555555;
		}
	}

	.scanBox {
		// margin: 0 24rpx;
		width: 702rpx;
		height: 374rpx;
		margin: 0 auto;
		background-image: url(../../static/fangwei/bg1.png);
		background-size: 100% 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 24rpx;
		// padding: 0 48rpx 0 24rpx;

		&_middle {
			width: 70%;
			display: flex;
			flex-direction: column;
			margin: 0 10rpx;

			text {
				color: #FFFFFF;
				font-size: 28rpx;
			}

			.title {
				font-size: 44rpx;
				font-weight: bold;
				margin-bottom: 10rpx;

			}
		}
	}

	.hint_box {
		margin-top: 30rpx;

		image {
			width: 40rpx;
			height: 40rpx;
			vertical-align: middle;
			margin-right: 10rpx;
		}

		text {
			font-size: 32rpx;
			color: $base-color;
			font-weight: bold;
		}

	}
</style>
