<template>
	<view class="content">
		<view style="background: #FFFFFF;">
			<view class="view1" style="text-align: center;">
				<view class="view_top">
					<view class="view_name">总资产(元)</view>
					<view style="font-size: 29px;">{{ money }}<text
							style="font-size: 31rpx;margin-left: 15rpx;">元</text></view>
					<!-- <view class="margin-top padding-top">累计提现金额：{{ totalMoney }}元</view> -->
				</view>
			</view>

			<view class="view2-views">
				<view class="view2_box">
					<view class="name">账户余额(元)</view>
					<view class="money">{{money}}</view>
				</view>
				<view class="btn" @tap="getOut">提现</view>
			</view>
		</view>

		<view class="view2">
			<view class="view2-view" @tap="moneyList">
				<image src="https://api.shengqianxiong.com.cn/img/20201118/22f17a68dc7446d6bef8e0a7a6cbac55.png"
					class="view2-view-image"></image>
				<view class="view2-view1">
					<view class="view2-view-text">钱包明细</view>
					<image
						src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
						class="view2-view-image-right"></image>
				</view>
			</view>
			<view class="view2-view" @click="goZhifuBao">
				<image src="https://api.shengqianxiong.com.cn/img/20201118/86efb280c3d2416e86e7b1900bbe17ff.png"
					class="view2-view-image"></image>
				<view class="view2-view1">
					<view class="view2-view-text">提现账号</view>
					<image
						src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
						class="view2-view-image-right"></image>
				</view>
			</view>
			<view class="view2-view" @tap="list">
				<image src="https://api.shengqianxiong.com.cn/img/20201118/5ce91ac860334fc9ac09c977467607cd.png"
					class="view2-view-image"></image>
				<view class="view2-view1">
					<view class="view2-view-text">提现记录</view>
					<image
						src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
						class="view2-view-image-right"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				money: '0.00',
				zhifubao: '',
				walletmoney: '0.00',
				totalMoney: '0.00',
				zhifubaoName: '',
			}
		},
		onLoad() {
			this.getwalletMoney();
		},
		onShow: function(e) {
			// this.getMoney();
			this.getwalletMoney();
		},
		methods: {
			ketixian() {
				uni.showModal({
					showCancel: false,
					confirmColor: '#e10a07',
					title: '可提现金额说明',
					content: '可提现金额是我们通过在商城中购买商品后返利的佣金，这个金额是可提现的'
				});
			},
			leijitixian() {
				uni.showModal({
					showCancel: false,
					confirmColor: '#e10a07',
					title: '累计提现金额说明',
					content: '累计提现金额是我们过往提现成功金额的总计'
				});
			},
			moneyList() {
				uni.navigateTo({
					url: '/my/other/cashList'
				})
			},
			list() {
				uni.navigateTo({
					url: '/my/other/moneydetail'
				})
			},
			goZhifuBao() {
				uni.navigateTo({
					url: "/my/other/zhifubao"
				})
			},
			//获取账户余额
			getwalletMoney() {
				this.$Request.getT('/shop/shopmoney/selectShopMoney').then(res => {
					if (res.code == 0) {
						this.money = res.data.money;
					}
					uni.hideLoading();
				});
			},
			// getMoney() {
			// 	let that = this;
			// 	let token = this.$queue.getData("token");
			// 	let userId = this.$queue.getData("userId");
			// 	if (token) {
			// 		//this.$queue.showLoading("加载中...");
			// 		//可以提现金额查询预估收入查询
			// 		this.$Request.getT("/cash/money/" + userId).then(res => {
			// 			if (res.status === 0 && res.data) {
			// 				// that.money = parseFloat(res.data).toFixed(2);
			// 			} else if (res.status === -102) {
			// 				this.$queue.showToast(res.msg);
			// 				this.$queue.logout();
			// 				uni.navigateTo({
			// 					url: '/pages/member/register'
			// 				});
			// 			} else {
			// 				// that.money = '0.00';
			// 				//this.$queue.showToast(res.msg);
			// 			}
			// 		});
			// 		this.$Request.getT("/cash/userinfo/" + userId).then(res => {
			// 			if (res.status === 0 && res.data) {
			// 				that.zhifubao = res.data.zhifubao;
			// 				that.zhifubaoName = res.data.zhifubaoName;
			// 			}
			// 			uni.hideLoading();
			// 		});
			// 		//总的提现记录
			// 		this.$Request.getT("/cash/countByRelationId/" + this.$queue.getData("relation_id")).then(res => {
			// 			if (res.status === 0 && res.data) {
			// 				that.totalMoney = parseFloat(res.data).toFixed(2);
			// 			} else {
			// 				that.totalMoney = '0.00';
			// 			}
			// 		});
			// 	}

			// },
			getOut() {
				uni.navigateTo({
					url: '/my/other/cashDetail'
				});
			},
		},
	}
</script>

<style lang='less'>
	/* @import "../../static/css/index.css"; */

	.view_top {
		padding: 35rpx 55rpx;
	}

	.view_name {
		font-size: 32rpx;
		letter-spacing: 2rpx;
		font-family: serif;
		margin-bottom: 10rpx;
	}

	.view1 {
		width: 90%;
		margin: 0 auto;
		height: 320rpx;
		border-radius: 16upx;
		/* color: #FFFFFF; */
		background: linear-gradient(to right, #FCB202 0, #FCD202 100%);
	}

	.view2 {
		background-color: #ffffff;
		margin-top: 15rpx;

	}

	.name {
		font-size: 28rpx;
	}

	.money {
		margin-top: 12rpx;
		font-size: 48rpx;
	}

	.btn {
		background: #FCD202;
		/* color: white; */
		text-align: center;
		width: 24%;
		padding: 16rpx 0rpx;
		border-radius: 6rpx;
	}

	.view2-view {
		display: flex;
		width: 100%;
		height: 110rpx;
		align-items: center;
	}

	.view2-views {
		display: flex;
		width: 90%;
		margin: 0 auto;
		height: 140rpx;
		align-items: center;
		justify-content: space-between;
		margin-top: 30rpx;
	}

	.view2-view1 {
		display: flex;
		flex-direction: row;
		width: 90%;
		align-items: center;
	}

	.view2-view-image {
		margin-left: 40upx;
		width: 50upx;
		height: 50upx;
	}

	.view2-view-text {
		font-size: 14px;
		color: #000000;
		margin-left: 40upx;
		width: 80%;
	}

	.view2-view-image-right {
		width: 19rpx;
		height: 31rpx;
		margin-left: 30rpx;
	}
</style>
