<template>
	<view class="page1">
		<view class="title-gary"></view>
		<view class="title">我的</view>
		<view class="shop-box" @click="navigatorTo('xiugaixinxi')">
			<view class="shop-left">
				<image :src="shopIcon" alt="">
			</view>
			<view class="shop-center">
				<!-- 入驻信息修改 、副标题 -->
				<view class="shop-name">{{shopName}}</view>
				<view class="shop-address">{{region}}</view>
			</view>
			<view class="shop-right">
				<uni-icons type="right" size="22"></uni-icons>
			</view>
		</view>
		<view class="list-box">
			<view class="list-1">
				<view class="list-icon">
					<uni-icons type="wallet" size="22"></uni-icons>
				</view>
				<view class="list-name">
					入驻审核
				</view>
				<view class="list-right">
					<uni-icons type="right" size="22"></uni-icons>
				</view>
			</view>
			<view class="list-1">
				<view class="list-icon">
					<uni-icons type="wallet" size="22"></uni-icons>
				</view>
				<view class="list-name" @click="navigatorTo('yingyexinxi')">
					营业信息
				</view>
				<view class="list-right">
					<uni-icons type="right" size="22"></uni-icons>
				</view>
			</view>
			<!-- <view class="list-1">
				<view class="list-icon">
					<uni-icons type="wallet" size="22"></uni-icons>
				</view>
				<view class="list-name">
					联系我们
				</view>
				<view class="list-right">
					<uni-icons type="right" size="22"></uni-icons>
				</view>
			</view> -->
			<view class="list-1" @click="navigatorTo('xiugaimima')">
				<view class="list-icon">
					<uni-icons type="wallet" size="22"></uni-icons>
				</view>
				<view class="list-name">
					修改密码
				</view>
				<view class="list-right">
					<uni-icons type="right" size="22"></uni-icons>
				</view>
			</view>
			<!-- <view class="list-1">
				<view class="list-icon">
					<uni-icons type="wallet" size="22"></uni-icons>
				</view>
				<view class="list-name">
					用户协议
				</view>
				<view class="list-right">
					<uni-icons type="right" size="22"></uni-icons>
				</view>
			</view> -->
			<view class="list-1" @click="navigatorTo('jianzhi')">
				<view class="list-icon">
					<uni-icons type="wallet" size="22"></uni-icons>
				</view>
				<view class="list-name">
					兼职
				</view>
				<view class="list-right">
					<uni-icons type="right" size="22"></uni-icons>
				</view>
			</view>
		</view>
		<view class="list-box">
			<view class="list-2" @click="logOut">
				退出登录
			</view>
		</view>
	</view>
</template>

<script>
	var jpushModule = uni.requireNativePlugin("JG-JPush");
	export default {
		data() {
			return {
				shopName:'',
				shopIcon:'',
				region:''
			}
		},
		props:{
			
		},
		watch: {
			
		},
		methods: {
			init(){
				this.shopName = JSON.parse(uni.getStorageSync('area')).shopName;
				this.shopIcon = JSON.parse(uni.getStorageSync('area')).shopIcon;
				this.region = JSON.parse(uni.getStorageSync('area')).region;
				 // 获取所有 key
				const { keys } = uni.getStorageInfoSync();
				const data = {};
				keys.forEach(key => {
				  data[key] = uni.getStorageSync(key);
				});
				
			},
			logOut() {
				uni.clearStorage()
				this.getRegistrationID()
				getApp().globalData.userinfo = ''
				uni.reLaunch({
					url: '../login/login'
				})
			},
			getRegistrationID() { //获取registerID
				jpushModule.getRegistrationID(result => {
					let registerID = result.registerID
					
					uni.setStorageSync("registerID", registerID)
					
				})
			},
			navigatorTo(e){
				let url = ""
				if(e=='addgoods'){
					url = '/package1/myCenter/addGoods'
				}else if(e=='merchant'){
					url = '/package1/myCenter/myMerchant'
				}else if(e == 'xiugaixinxi'){
					url = '/pages/myCenter/shopDetail'
				}else if(e == 'yingyexinxi'){
					url = '/pages/myCenter/businessInfo'
				}else if(e == 'xiugaimima'){
					url = '/pages/login/regist?type=3'
				}else if(e == 'jianzhi'){
					url = '/pages/worker/index'
				}
				
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style>
	page{
		width: 100%;
		height: 100%;
		font-size: 28rpx;
	}
	.page1 {
		width: 100%;
		height: 100%;
		font-size: 28rpx;
	}
	.title-gary{
		width: 100%;
		height: 80rpx;
		background: #777;
	}
	.title{
		width: 100%;
		height: 100rpx;
		background: #fff;
		line-height: 100rpx;
		text-align: center;
	}
	.shop-box{
		width: 100%;
		height: 200rpx;
		background: #fff;
		border-top: 1px solid #eee;
		display: flex;
	}
	.shop-left{
		width: 100rpx;
		height: 100rpx;
		padding: 50rpx;
	}
	.shop-left image{
		width: 100rpx;
		height: 100rpx;
		background-size: 100%;
	}
	.shop-center{
		flex: 1;
		line-height: 60rpx;
	}
	.shop-right{
		width: 10%;
		line-height: 200rpx;
		text-align: center;
	}
	.shop-name{
		margin-top: 50rpx;
		font-weight: 700;
		font-size: 30rpx;
	}
	
	.list-1{
		display: flex;
		width: 100%;
		height: 100rpx;
		line-height: 100rpx;
		border-bottom: 1px solid #eee;
	}
	.list-box{
		width: 100%;
		height: auto;
		background: #fff;
		margin-top: 20rpx;
	}
	.list-2{
		width: 100%;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		border-bottom: 1px solid #eee;
	}
	.list-icon{
		width: 100rpx;
		height: 100rpx;
		text-align: center;
	}
	.list-name{
		flex: 1;
	}
	.list-right{
		width: 50rpx;
		height: 100rpx;
	}
</style>