<template>
	<view class="box">
		<view class="card-box">
			<view class="card-title">
				<text class="title">资产估值(USDT)</text>
				<text v-show="showMoney" @click.stop="showMoney = !showMoney"
					class="title-icon iconfont">&#xe661;</text>
				<text v-show="!showMoney" @click.stop="showMoney = !showMoney"
					class="title-icon iconfont">&#xe6fa;</text>
				<!-- <image class="icon" src="../../../static/logo.png" mode="aspectFit"></image> -->
			</view>
			<view class="card-num" v-show="showMoney">
				<slot name="cardnum"></slot>
			</view>
			<view class="card-num" v-show="!showMoney">
				*****
			</view>
			<view class="card-nums" v-show="showMoney">
				<text class="nums-icon iconfont">≈</text>
				<text class="nums-icon iconfont">&#xe617;</text>
				<text>
					<slot name="cardnums"></slot>
				</text>
			</view>
			<view class="card-nums" v-show="!showMoney">
				<text>*****</text>
			</view>
			<view class="card-muen">
				<slot name="cardmuen"></slot>
				<!-- <block v-for="(item , index ) in cardMuen[cardIndex]">
					<template v-if="[0,2,3].includes(cardIndex)">
						<view class="card-muen-item_1" @click.stop="cardBtns(item)">
							<image class="item-icon" :src="item.icon" mode="aspectFit"></image>
							<text class="item-name">{{item.name}}</text>
						</view>
					</template>
					<template v-else-if="[1].includes(cardIndex)">
						<view class="card-muen-item_2" @click.stop="cardBtns(item)">
							<image class="item-icon" :src="item.icon" mode="aspectFit"></image>
							<text class="item-name">{{item.name}}</text>
						</view>
					</template>
				</block> -->
			</view>
		</view>
		


 

		<!-- GiftMoney / 赠金账户 -->
		<!-- <GiftMoney ref="GiftMoneyRef" /> -->


	</view>
</template>

<script>
  
	export default {
		name: 'cardModules',
		props: {
			userInfo: {
				type: [String, Object],
				default: null
			},
			cardIndex: {
				type: Number,
				default: 0
			}
		},
		components: {
			// capitalSwitch,
			// GiftMoney,
		 
		},
		watch:{
			showMoney:{
				handler(newStatus){
					this.$emit('updateShowMoneyStatus' , newStatus)
				},
				immediate:true
			}
		},
		data() {
			return { 
				showMoney:true,
				cardMuen: [
					 
					
				]
			};
		},
		methods: {
			cardBtns(item) {
				const btn = item?.btn

				if (btn) {
					switch (btn) {
						case 'capitalSwitch':
							// 资金转换
							this.$nextTick(() => {
								this.$refs.capitalSwitchRef.open()
							})
							break;
						case 'BibiSwitch':
							// 币币账户  - 资金转换
							this.$nextTick(() => {
								this.$refs.BibiSwitchRef.open()
							})
							break;


						case 'GiftMoney':
							// 资金转换
							this.$nextTick(() => {
								this.$refs.GiftMoneyRef.open()
							})
							break;

					}
					return false
				}

				const path = item?.path
				if (path) {
					uni.navigateTo({
						url: path
					});
				}
			},
			// 资金转换
			openCapitalSwitch() {

			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "~./card.scss"
</style>