<template>
	<view class="mine_content">
		<info></info>
		<wealth @clickType='clickType'></wealth>
		<module @clickType='clickType'></module>
		<!-- <button @click="clearUserData()"> 删除用户</button> -->
	</view>
</template>

<script setup lang="ts">
	import info from '../mine/mine-info.vue'
	import wealth from '../mine/mine-wealth.vue'
	import module from '../mine/mine-module.vue'
	
    import { config } from '../../config/config';
	import { http } from '../../framework/http';
	import { util } from '../../framework/util';
	import { UserData } from '../../stores/userDataManager'; 
    import { sdkUtil } from '../../framework/sdkUtil';
	
	function clickType(type:number) {
		switch (type){
			case config.mine_goto_type.SHUBI:
			    uni.navigateTo({
			    	url:'/pagesA/recharge/rechargeCoin'
			    })
				break;
			case config.mine_goto_type.VIP:
			    uni.navigateTo({
			    	url:'/pagesA/recharge/rechargeVIP'
			    })
				break;
			case config.mine_goto_type.TIANJIAZHUOMIAN:
			    sdkUtil.addShortcut(()=>{
					
				})
				break;
			case config.mine_goto_type.JIAOYIJILU:
			    uni.navigateTo({
			    	url:'/pagesA/tradingRecord/tradingRecord'
			    })
				break;
			case config.mine_goto_type.LIANXIKEFU:
				break;
			case config.mine_goto_type.GUANYUWOMEN:
			    uni.navigateTo({
			    	url:'/pagesA/aboutMine/aboutMine'
			    })
				break;
			default:
				break;
		}
	}
	
	function clearUserData(){
		uni.showLoading({
			title:"清除用户...",
			mask:true
		})
		http.DynamicRequest(config.url_confg.Dynamic.reset,{'user_id':UserData().getData().user_id},(err,d)=>{
			if(!err){
				if(d.code == config.url_confg.StatesCode.SUCCESS){
					util.clearAllStorage()
					uni.hideLoading()
				}
			}
		})
	}
</script>

<style lang="scss">
	.mine_content{
		// display: flex;
		// flex-direction: column;
	}
</style>