<template>
	<view class="content">
		<headersVue :titles="titles"><u-icon name="arrow-left" color="#fff" size="18"></u-icon></headersVue>
		<view class="top_">
			<view class="list_ds">
				<view class="pm_">排名</view>
				<view class="cx_">车型</view>
			</view>
			<view class="list_ds">
				<view class="pm_">销量</view>
				<view class="">营业额</view>
			</view>
		</view>
		<view class="top_" v-for="(item,index) in ping" :key="index">
			<view class="list_ds">
				<view class="pm_" v-if="index != 0 && index != 2 && index != 1">{{index + 1}}</view>
				<view class="v-icon" v-if="index == 0">
					<image src="../../static/detection/dy.png" mode=""></image>
				</view>
				<view class="v-icon" v-if="index == 1">
					<image src="../../static/detection/dr.png" mode=""></image>
				</view>
				<view class="v-icon" v-if="index == 2">
					<image src="../../static/detection/ds.png" mode=""></image>
				</view>
				<view class="cx_">{{item.goodsName}}</view>
			</view>
			<view class="list_ds">
				<view class="xl_">{{ item.salesNum }}</view>
				<view class="e_">{{ item.salesAmount }}</view>
			</view>
		</view>
	</view>

</template>

<script>
	import headersVue from '../../components/header/headers.vue';
	import request from "@/utils/request";

	export default {
		data() {
			return {
				titles: "当日订单统计",
				user: {},
				ping: [],
				show: false,
				status: 'loading',
			}
		},
		components: {
			headersVue
		},
		onLoad() {
			this.getindex()
		},
		methods: {
			//初始化获取
			async getindex() {
				// 首页信息
				let res = await request({
					url: '/partnerOwn/partner/shopInfo',
					method: 'get',
				})
				this.user = res.data
				this.partnerId = res.data.partnerId
				uni.setStorageSync('partnerId', res.data.partnerId)
				if (res.data.isWorking == "0") {

					this.isWorking = false
				}
				if (res.data.isWorking == "1") {
					this.isWorking = true
				}
				// 中间统计
				let reszj = await request({
					url: '/partnerOwn/partner/statisticsInfo?partnerId=' + this.partnerId,
					method: 'get',
				})
				let nums = {
					orderAmount: reszj.data.orderAmount / 100,
					orderNum: reszj.data.orderNum,
					todayOrderAmount: reszj.data.todayOrderAmount / 100,
					todayOrderNum: reszj.data.todayOrderNum,
					workedNum: reszj.data.workedNum,
					workingNum: reszj.data.workingNum,
					srlNum: reszj.data.srlNum,
					hgNum: reszj.data.hgNum,

				}
				this.threenum = nums

				// 热销产品
				let resrx = await request({
					url: '/partnerOwn/partner/hotGoodsList?partnerId=' + this.partnerId,
					method: 'get',
				})
				this.ping = resrx.data
				// this.getswitch()
			},
		}

	}
</script>

<style scoped lang="scss">
	.content {

		width: 100%;
		// height: 100vh;
		box-sizing: border-box;
		// padding: 30rpx;
		padding-top: 200rpx;
		font-size: 28rpx;
		color: #101A3E;
	}

	.top_ {
		width: 100%;
		height: 100rpx;
		background: #fff;
		display: flex;
		align-items: center;
		box-sizing: border-box;
		justify-content: space-between;
		padding: 30rpx 40rpx;
	}

	.pm_ {
		margin-right: 80rpx;
		text-align: center;
		width: 60rpx;
	}

	.list_ds {
		display: flex;
		align-items: center;
	}

	.e_ {
		width: 140rpx;
		text-align: right;
	}

	.xl_ {
		width: 60rpx;
	}

	.cx_ {
		width: 250rpx;
	}

	.v-icon {
		width: 30px;
		height: 30px;
		margin-right: 43px;

		image {
			width: 100%;
			height: 100%;
		}
	}
</style>