<template>
	<!-- 分销 导航 佣金统计主页 -->
	<!-- tabbar -->
	<view class="reseller">
		<view class="top">
			<view class="num" style="margin-left: 30px;">
				<view>昨日收益</view>
				<view class="txc">{{counts.money_yesterday?counts.money_yesterday:0}}</view>
			</view>
			<view class="num1" style="">
				<view>可提现</view>
				<view style="font-size: 40px;">{{counts.gold?counts.gold:0}}</view>
			</view>
			<view class="num" style="margin-right: 30px;">
				<view>累计已提</view>
				<view>{{counts.amount_cash?counts.amount_cash:0}}</view>
			</view>
			<view class="tixian" @click="jump_cash">
				<view class="btn" style="font-size: 16px;">立即提现</view>
			</view>
			<view class="jilu">
				<navigator url="/pages/user/record/record"><view class="jl">提现记录 ></view></navigator>
			</view>
		</view>

		<view class="icon">
			<view class="ico mt-40" >
				<navigator url="/pages/storeqrcode/storeqrcode">
					<view class="tubiao">
						
						<image class="img" src="/static/icon/rqcodeicon.png"></image>
					</view>
					<view class="tt">
						<view class="text">店铺二维码</view>
					</view>
				</navigator>
			</view>
			<view class="ico mt-40" >
				<navigator url="/pages/user/mingxi/mingxi">
					<view class="tubiao">
						
						<image class="img" src="/static/icon/zijin.png"></image>
					</view>
					<view class="tt">
						<view class="text">佣金明细</view>
					</view>
				</navigator>
			</view>
			<view class="ico mt-40" >
				<navigator url="/pages/user/fenxiao/bankcard/bankcard">
					<view class="tubiao">
						
						<image class="img" src="/static/icon/ordericons.png"></image>
					</view>
					<view class="tt">
						<view class="text">银行卡</view>
					</view>
				</navigator>
			</view>
			<view class="ico mt-40" >
				<navigator url="/pages/setup/setup">
					<view class="tubiao">
						
						<image class="img" src="/static/icon/setupicon.png"></image>
					</view>
					<view class="tt">
						<view class="text">设置</view>
					</view>
				</navigator>
			</view>
			
		</view>
		<view class="kong"></view>
		
		<yomol-upgrade   ref="yomolUpgrade"></yomol-upgrade>
		<!-- 升级组件 -->
	</view>
</template>

<script>
	import {storeIndex} from "@/utils/api/api.js";
	import yomolUpgrade from '@/components/yomol-upgrade/yomol-upgrade.vue';//升级组件
	export default {
		data() {
			return {
				list: [
				],
				counts:{},//统计的数据
			}
		},
		components: {
			yomolUpgrade
		},
		onLoad() {
			
		},
		//下拉刷新
		onPullDownRefresh(){
			this.getstoreIndex();
			// uni.stopPullDownRefresh();//结束下拉刷新
		},
		onShow() {
			this.getstoreIndex();
			//检测更新
			setTimeout(()=>{
				// #ifdef APP-PLUS
				this.$refs.yomolUpgrade.checkVersionClick();
				// #endif
			},1000)
		},
		methods:{
			//获取统计信息接口
			async getstoreIndex(){
				let res = await storeIndex({
					
				});
				uni.stopPullDownRefresh();
				if(res.code==0){
					this.counts = res.data.counts;
				}else{
					this.$api.msg(res.msg);
				}
			},
			jump_cash(){
				uni.navigateTo({
					url: '/pages/yjWithdraw/yjWithdraw?type=2',
				});
			}
		}
	}
</script>

<style lang="scss">
	@import "./reseller.scss";
</style>
