<template>
	<view class="">
    <navigation :showBack="false">
    Orders
	<image src="../../../static/color/top_icon_ins@3x.png" mode="aspectFit" class="back" @click="back()"></image>
    </navigation>
		<view class="">
			<u-tabs :bold="false" active-color="#fff"  inactive-color="rgba(135,109,164)" bg-color="#300261" height="108" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
		</view>
		<tab-bar :selectActive="5"></tab-bar>
	</view>

</template>

<script>
	import Vue from 'vue';
		import balance from "@/components/balance/balance.vue"
		import api from '@/utils/api'
	export default {
		data() {
			return {
				list: [{
								name: 'All'
							}, {
								name: 'Undeliver'
							}, {
								name: 'Unreceive',
							},
							{
								name: 'Success',
							},
							],
							current: 0
			}
		},
		onLoad() {
          this.openGame()
		
		},
		methods: {
			openGame() {
				const post = api.info()
				post.then(d => {
						// uni.setStorage({
						// 	key: 'Gamestatus',
						// 	data: d.data.gameMenuStatus,
						// });
					
						if (d.data.gameMenuStatus == 'close') {
							uni.setTabBarItem({
								index: 2,
								text: 'Order',
								pagePath:'/pages/menu/order/index',
								iconPath: '/static/tabbar/dorder.png',
								selectedIconPath: '/static/tabbar/dorderS.png'
							})
						}else if (d.data.gameMenuStatus == 'open'){
							uni.setTabBarItem({
								index: 2,
								text: 'Game',
								pagePath: "/pages/menu/color/index",
								iconPath: "./static/tabbar/meun_icon_game_nor@2x.png",
								selectedIconPath: "./static/tabbar/meun_icon_game_sel@2x.png"
							})
						}
					})
					.catch((e) => {
						console.log(e)
					})
			},
		change(index) {
						this.current = index;
					},
					back(){
						uni.switchTab({
							url:'/pages/menu/My/index'
						})
					},
		}
	}
</script>

<style>
	/deep/ .u-tab-bar{
		background-color: #954DE3 !important;
	}
	/* #ifdef APP-PLUS  */
		.back{
			width: 42rpx;
			height: 42rpx;
			position: absolute;
			left:36rpx;
		    top: 60%;
			transform: translateY(-50%) rotate(-180deg) ;
		
		}
		  /*  #endif   */
	.back{
			width: 42rpx;
			height: 42rpx;
			position: absolute;
			left:36rpx;
	        top: 50%;
			transform: translateY(-50%) rotate(-180deg) ;
		
		}

</style>
