<template>
	<view class="page">
		<view class="bg"><image src="/static/bg.jpg"></image></view>
		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
			<view class="content">
			  <view class="banner">
			  	<swiper class="screen-swiper" indicator-dots="true" circular="true" autoplay="true" interval="5000"
			  		duration="500">
			  		<swiper-item v-for="(item,index) in swiperList" :key="index">
			  			<image :src="item.url" mode="aspectFill"></image>
			  		</swiper-item>
			  	</swiper>
			  </view>
			  
			  <view class="menu-nav">
			  		<view class="nav">
			  			<view class="list" @click="tzyl">
			  				<view><image src="/static/new/1.png" mode="heightFix"></image></view>
			  				<view class="text">养老</view>
			  			</view>
			  			<view class="list" @click="minor">
			  				<view><image src="/static/new/2.png" mode="heightFix"></image></view>
			  				<view class="text">个案登记</view>
			  			</view>
						<view class="list" @click="map">
							<view><image src="/static/new/3.png" mode="heightFix"></image></view>
							<view class="text">区域申报</view>
						</view>
						<view class="list" @click="funeral">
							<view><image src="/static/new/4.png" mode="heightFix"></image></view>
							<view class="text">殡葬</view>
						</view>
						<!-- <view class="list" @click="toponym">
							<view><image src="/static/new/image 1.png" mode="heightFix"></image></view>
							<view class="text">地名申报</view>
						</view>
						<view class="list" @click="lmpsb">
							<view><image src="/static/new/image 2.png" mode="heightFix"></image></view>
							<view class="text">地名查询</view>
						</view>
						<view class="list" @click="gopath('/pages/policy/policy')">
							<view><image src="/static/new/image 3.png" mode="heightFix"></image></view>
							<view class="text">政策文件</view>
						</view>
						<view class="list" @click="journalism">
							<view><image src="/static/new/image 4.png" mode="heightFix"></image></view>
							<view class="text">新闻资讯</view>
						</view> -->
			  		</view>
			  </view>
			</view>
			<!-- 服务 -->
			<view class="xw" style="padding-top: 20rpx;padding-left: 20rpx;">
				<view class="title">
					<view class="box1">
						<image src="../../static/new/矩形 331.png" mode=""></image>
						<span>殡葬服务</span>
					</view>
				</view>
				<view class="content">
					<view class="box_item" @click="funeralculture">
						<view>
							<image src="/static/nav/nav_ico7.png" style="width: 90%;" mode="widthFix"></image>
						</view>
						<view class="text">文化宣传</view>
					</view>
					<view class="box_item" @click="funerallaw">
						<view>
							<image src="/static/nav/nav_ico8.png" style="width: 90%;" mode="widthFix"></image>
						</view>
						<view class="text">普法宣传</view>
					</view>
					<view class="box_item" @click="funeralguide">
						<view>
							<image src="/static/nav/nav_ico9.png" style="width: 90%;" mode="widthFix"></image>
						</view>
						<view class="text">办事指南</view>
					</view>
					<view class="box_item" @click="funeralproblem">
						<view>
							<image src="/static/nav/nav_ico10.png" style="width: 90%;" mode="widthFix"></image>
						</view>
						<view class="text">常见问题</view>
					</view>
				</view>
			</view>
			
			<view class="xw" style="padding-top: 20rpx;padding-left: 20rpx;">
				<view class="title">
					<view class="box1">
						<image src="../../static/new/矩形 331.png" mode=""></image>
						<span>区域服务</span>
					</view>
				</view>
				<view class="content" style="margin-bottom:40rpx;">
					<view class="box_item" @click="gopath('/pages/declaration/declaration?type=5')">
						<view style="margin-bottom: 20rpx;">
							<image src="/static/ly/image11.png" style="width: 60%;height: 90rpx;" mode=""></image>
						</view>
						<view class="text">门楼牌申报</view>
					</view>
					<view class="box_item" @click="gopath('/pages/mapdoorplate/mapdoorplate')">
						<view style="margin-bottom: 20rpx;">
							<image src="/static/ly/image8.png" style="width: 60%;height: 90rpx;" mode=""></image>
						</view>
						<view class="text">地名标志牌申报</view>
					</view>
					<view class="box_item" @click="gopath('/pages/declaration/declaration?type=3')">
						<view style="margin-bottom: 20rpx;">
							<image src="/static/ly/image5.png" style="width: 60%;height: 90rpx;" mode=""></image>
						</view>
						<view class="text">建筑物备案</view>
					</view>
					<view class="box_item" @click="gopath('/pages/declaration/newDeclaration')">
						<view style="margin-bottom: 20rpx;">
							<image src="/static/ly/image6.png" style="width: 60%;height: 90rpx;" mode=""></image>
						</view>
						<view class="text">地名命名申报</view>
					</view>
				</view>
				<view class="content" style="margin-top: -70rpx;z-index: 10000;padding: 0 20rpx;">
					<view class="box_item" @click="lmpsb">
						<view style="margin-bottom: 20rpx;">
							<image src="/static/new/image 2.png" style="width: 60%;height: 90rpx;" mode=""></image>
						</view>
						<view class="text">地名查询服务</view>
					</view>
				</view>
			</view>
			
			<view class="xw" style="">
				<view class="title">
					<view class="box1">
						<image src="../../static/new/矩形 331.png" mode=""></image>
						<span>未保服务</span>
					</view>
				</view>
				<view class="content">
					<view class="box_item" @click="minor">
						<view style="margin-bottom: 20rpx;">
							<image src="/static/new/2.png" style="height: 100rpx;" mode="heightFix"></image>
						</view>
						<view class="text">个案登记</view>
					</view>
				</view>
			</view>
					
		</view>
	</view>
	    
</template>

<script>
	import md5 from "../../common/md5.js";
	export default {
		data() {
			return {
				nvConfig:{
					title:"数字民政服务平台",
					bgColor:"#ffffff",
					color:"#000000",
					fixedAssist:{
						hide:true,
					},
					transparent:{
						initColor:"#000",
					},
					back:{
						hide:true
					},
				},
				swiperList: [{
						id: 0,
						type: 'image',
						url: '/static/img/1.jpg'
					},
					{
						id: 1,
						type: 'image',
						url: '/static/img/1.jpg'
					},
				],
			}
		},
		onPageScroll(e) {this.$refs.nv.pageScroll(e)},
		computed:{
			pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
		},
		onLoad() {
			uni.hideTabBar();
		},
		methods: {
			// 
			funeralculture() {
				uni.navigateTo({
					url: '/pages/funeralculture/funeralculture'
				})
			},
			funerallaw() {
				uni.navigateTo({
					url: '/pages/funerallaw/funerallaw'
				})
			},
			funeralguide() {
				uni.navigateTo({
					url: '/pages/funeralguide/funeralguide'
				})
			},
			funeralproblem() {
				uni.navigateTo({
					url: '/pages/funeralproblem/funeralproblem'
				})
			},
			// 
			gopath(e) {
				uni.navigateTo({
					url: e
				})
			},
			// 
			gopath(e) {
				uni.navigateTo({
					url: e
				})
			},
			toponym() {
				uni.navigateTo({
					url:"/pages/declaration/newDeclaration"
				})
			},
			tzyl(){
				// window.location.href = `http://show.rsxmzj.91xxt.com:81/2023/renshou/index.html?p=${t}&t=${time}&sign=${encryptedstr}`
				uni.navigateTo({
					url:"/pages/webview/webview"
				})
			},
			lmpsb(){
				uni.navigateTo({
					// url:'/pages/mapdoorplate/mapdoorplate'
					url:'/pages/map1/map'
					// url: '/pages/receiptRegistration/receiptRegistration'
				})
			},
			minor() {
				uni.navigateTo({
					// url:'/pages/mapdoorplate/mapdoorplate'
					url: '/pages/receiptRegistration/receiptRegistration'
				})
				// uni.navigateTo({
				// 	url: '/pages/minor/minor'
				// })
			},
			journalism() {
				uni.navigateTo({
					url: '/pages/journalism/journalism'
				})
			},
			// 获取用户信息
			hquserinfo(){
				var info = {
					userId:uni.getStorageSync("USERS_KEY").userId,
				}
				this.API.hquserinfo(info).then(res=>{
					console.log("获取用户信息",res);
					this.user.nickName = res.data.nickName;
					this.user.avatar = res.data.avatar
					this.user.deptId = res.data.deptId
					console.log("信息",this.user);
				})
			},
			funeral() {
				var info = {
					userId:uni.getStorageSync("USERS_KEY").userId,
				}
				this.API.hquserinfo(info).then(res=>{
					console.log("获取用户信息",res);
					console.log("信息1",res.data.roles[0].roleName,uni.getStorageSync('userjs'));
					if(res.data.roles[0].roleName != uni.getStorageSync('userjs')){
						uni.reLaunch({
							url: '/pages/login/login'
						});
						return
					}
					if(uni.getStorageSync('userjs') == null || uni.getStorageSync('userjs') == undefined){
						uni.reLaunch({
							url: '/pages/login/login'
						});
						return
					}
					
					if(uni.getStorageSync('userjs') != '普通用户'){
						uni.switchTab({
							url: '/pages/my/my'
						})
					}else{
						uni.switchTab({
							url: '/pages/funeral/funeral'
						})
					}
				})
				
			},
			map() {
				uni.navigateTo({
					url: '/pages/declaration/list'
				})
				// uni.navigateTo({
				// 	url: '/pages/map/map'
				// })
			},
			map1() {
				uni.navigateTo({
					url: '/pages/map1/map'
				})
			},
			xwtz(){
				uni.navigateTo({
					url:"/pages/xw/xw"
				})
			}
		}
	};
</script>
<style scoped lang="scss">
	@import 'home.scss';
</style>
