<template>
	<view class="content">
		<view class="container">
			<headers :titles="titles"></headers>
			<view class="top-box">
				<view class="title_top">京博加油站</view>
				<view class="title_centen">
					<view class="sm-size">今日营业额(元)</view>
					<view class="big-size">{{indexData.totalPayMoney}}</view>
				</view>
				<!--        123-->
				<view class="ds-ab">
					<view class="sm-size">收款笔数 {{indexData.totalCount}}</view>
					<view class="sm-size">退款笔数 {{indexData.totalRefund}}</view>
				</view>
				<view class="jg-box">
					<view class="s-box" @click="goCollection()">
						<view class="">
							<image src="/static/imgs/sk.png" mode=""></image>
						</view>
						<view class="">收款</view>
					</view>
					<view class="s-box" @click="goRecharge()">
						<view class="">
							<image src="/static/imgs/cz.png" mode=""></image>
						</view>
						<view class="">充值</view>
					</view>
					<view class="s-box" @click="goCode()">
						<view class="">
							<image src="/static/imgs/skm.png" mode=""></image>
						</view>
						<view class="">收款码</view>
					</view>
				</view>
			</view>
			<!--  -->
			<view class="gq-box">
				<view class="ss-box" @click="goAdd()">
					<view class="">
						<image src="/static/imgs/xzhy.png" mode=""></image>
					</view>
					<view class="">新增会员</view>
				</view>
				<view class="ss-box" @click="goBusinessData()">
					<view class="">
						<image src="/static/imgs/jysj.png" mode=""></image>
					</view>
					<view class="">经营数据</view>
				</view>
				<view class="ss-box" @click="goOrderlist()">
					<view class="">
						<image src="/static/imgs/dd.png" mode=""></image>
					</view>
					<view class="">订单</view>
				</view>
				<view class="ss-box" @click="gochangeShifts()">
					<view class="">
						<image src="/static/imgs/jjb.png" mode=""></image>
					</view>
					<view class="">交接班</view>
				</view>
			</view>
			<!-- bai -->
			<view class="bai-box">
				<u-icon name="bell" color="#E61D2A" size="18"></u-icon>
				<view class="hy-size">您有新的交易日报生成，请点击查看</view>
			</view>
		</view>
		<tabbar :msg='msg'></tabbar>
	</view>
</template>

<script>
	import request from "../../utils/request";
	import headers from '../../components/header/headers.vue'
	import tabbar from '../../components/tabbar/tabbar.vue'
	export default {
		data() {
			return {
				titles: "",
				msg: "0",
				List: [],
				show: false,
				status: 'loading',
				indexData: {
					totalPayMoney: '0',
					totalCount: '0',
					totalRefund: '0',
				}
			}
		},
		onShow() {
			// this.actList = ["1", "1", "1", "1", "1", ]
			// this.status = "nomore" 底部刷新结束
			this.getIndexData();
		},
		onPullDownRefresh() {
			console.log("刷新");
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			// this.show = true
			setTimeout(() => {
				console.log("加载执行");
			}, 2000)
		},
		components: {
			headers,
			tabbar
		},
		methods: {
			goRecharge() {
				uni.navigateTo({
					url: "/pagesHome/MemberRecharge/MemberRecharge"
				})
			},
			goCode() {
				uni.navigateTo({
					url: '/pagesHome/PaymentCode/PaymentCode'
				})
			},
			gochangeShifts() {
				uni.navigateTo({
					url: '/pagesHome/changeShifts/changeShifts'
				})
			},

			goAdd() {
				uni.navigateTo({
					url: '/pagesHome/AddVip/AddCode'
				})
			},
			goCollection() {
				uni.navigateTo({
					url: '/pagesHome/Collection/Collection'
				})
			},
			goOrderlist() {
				uni.navigateTo({
					url: '/pagesHome/orderList/orderList'
				})
			},
			goBusinessData() {
				uni.navigateTo({
					url: '/pagesHome/BusinessData/BusinessData'
				})
			},
			goback() {
				uni.navigateBack()
			},

			// 获取销售数据
			getIndexData() {
				request({
					url: 'business/allOrderInfo/getIndexData4Pos',
					method: 'get',
					params: this.form
				}).then((res) => {
					if (res.code == 200) {
						this.indexData = res.data
					} else {
						uni.showToast({
							title: res.data,
							icon: "none"
						})
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		background: #f4f5f6;
		// background: linear-gradient(180deg, #B2D2FC 0%, #B2D2FC 14%, rgba(255, 255, 255, 0.84) 24%, rgba(255, 255, 255, 0.84) 100%);
		height: 100vh;
	}

	.container {
		width: 100%;
		background: #f4f5f6;
		box-sizing: border-box;
		padding-top: 88px;
	}

	.top-box {
		width: 100%;
		height: 185px;
		background: url('../../static/imgs/homeback.png');
		background-size: 100% 100%;
		box-sizing: border-box;
		padding: 15px;
		color: #fff;
		padding-top: 0px;
		position: relative;
	}

	.title_top {
		font-weight: bold;
		font-size: 16px;
		color: #FFFFFF;
		margin-bottom: 15px;
	}

	.title_centen {
		width: 100%;
		text-align: center;
		margin-bottom: 15px;
	}

	.sm-size {
		font-weight: bold;
		font-size: 14px;
		color: #FFFFFF;
		margin-bottom: 10px;
	}

	.big-size {
		font-weight: 800;
		font-size: 24px;
		color: #FFFFFF;
	}

	.ds-ab {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-around;
	}

	.jg-box {
		width: 95%;
		background: #fff;
		border-radius: 8px;
		box-sizing: border-box;
		padding: 10px;
		margin: 0 auto;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.s-box {
		width: 33.3%;
		font-size: 14px;
		color: #333333;
		text-align: center;

		image {
			width: 40px;
			height: 40px;
			margin: 5px auto;
		}
	}

	.ss-box {
		width: 25%;
		font-size: 14px;
		color: #333333;
		text-align: center;

		image {
			width: 40px;
			height: 40px;
			margin: 5px auto;
		}
	}

	.gq-box {
		width: 95%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0 auto;
		margin-top: 65px;
	}

	.bai-box {
		width: 95%;
		border-radius: 6px;
		background: #fff;
		box-sizing: border-box;
		padding: 10px 15px;
		display: flex;
		align-items: center;
		font-size: 14px;
		margin: 15px auto;
	}

	.hy-size {
		width: 80%;
		overflow: hidden;
		margin-left: 10px;
	}
</style>