<template>
	<view>
		<view>
			<uni-collapse :accordion="true">
				<uni-list>
					<view v-show="show">
						<uni-list-item :title="$t('remoteList.dosugur')" @click="sugar()" />
					</view>
					<view v-show="show">
						<uni-list-item :title="$t('remoteList.flowers')" @click="flowers()" />
					</view>
					<view v-show="show2">
						<uni-list-item :title="$t('remoteList.parameters')" @click="parameters()" />
					</view>
					<view v-show="show">
						<uni-list-item :title="$t('remoteList.alarmClock')" @click="alarmClock()" />
					</view>
					<view v-show="show">
						<uni-list-item :title="$t('remoteList.volume')" @click="volume()" />
					</view>
					<view v-show="show">
						<uni-list-item :title="$t('remoteList.password')" @click="password()" />
					</view>
					<view v-show="show4">
						<uni-list-item :title="$t('remoteList.payment')" @click="payment()" />
					</view>
					<view v-show="show">
						<uni-list-item :title="$t('remoteList.price')" @click="price()" />
					</view>
					<view v-show="show3">
						<uni-list-item title="解绑机器" @click="jiebang()" />
					</view>
					<view v-show="show3">
						<uni-list-item title="连接服务器审核" @click="lianjie()" />
					</view>
				</uni-list>
			</uni-collapse>
		</view>
	</view>
</template>

<script>
	import uniList from '@/components/uni-list/uni-list.vue'
	import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
	import {
		mapState,
		mapActions,
		mapMutations
	} from 'vuex'
	import {
		dateUtils
	} from '@/common/util.js';
	export default {
		data() {
			return {
				show: true,
				show2: true,
				show3: false,
				show4: false,
			}
		},
		onShow(state) {
			var globalUser = uni.getStorageSync("globalUser");
			console.log(globalUser);
			var gid = globalUser.id;
			var name = globalUser.name;
			var ifForeign = globalUser.ifForeign;
			if(gid == 1150){
				this.show3 = true;
			}
			if(ifForeign == '1') {
				this.show4 = true;
			}
			uni.setNavigationBarTitle({
				title: this.$t('remoteList.title')
			});
			// if (gid != 1||gid != 236||name!="邱咪") {
			// this.show = true;
			// this.show2 = true;
			// }
		},
		methods: {
			sugar() {
				uni.navigateTo({
					url: 'dosugar',
				});
			},
			flowers(){
				uni.navigateTo({
					url:'flowerShow'
				})
			},
			parameters() {
				uni.navigateTo({
					url: './parameters',
				});
			},
			alarmClock() {
				uni.navigateTo({
					url: 'alarmClockList',
				});
			},
			volume() {
				uni.navigateTo({
					url: 'volume',
				});
			},
			jiebang() {
				uni.navigateTo({
					url: 'jiebang',
				});
			},
			lianjie() {
				uni.navigateTo({
					url: 'lianjie',
				});
			},
			password() {
				uni.navigateTo({
					url: 'updatePassword',
				});
			},
			price() {
				uni.navigateTo({
					url: '/packageB/pages/remote/updatePrice',
				});
			},
			payment() {
				uni.navigateTo({
					url: '/packageB/pages/remote/updatePayment',
				});
			},
		}
	}
	
	
</script>

<style>

</style>
