<!--首页管理-->
<template>
<div>
<!--market-->
<el-card v-if="task1.length!=0" >
<el-carousel :interval="3000" indicator-position="outside">
<el-carousel-item v-for="(item,index) in task1" :key="index">
<div >
<span >等待处理</span>
<el-link type="primary" @click="ListClick" >查看更多>></el-link>
</div>
<div >
<h1 >订单名称:{{item.id}}</h1>
<p >状态:{{item.status_name}}</p>
</div>
<div >
<p >创建时间:{{item.created_at}}</p>
</div>
<div >
<p >账号:{{item.account.name}}</p>
<el-button type="primary" @click="ListClick" >去审核</el-button>
</div >
</el-carousel-item>
</el-carousel>
</el-card>
<el-card v-if="order1.length!=0" >
<el-carousel :interval="3000" indicator-position="outside">
<el-carousel-item v-for="(item,index) in order1" :key="index">
<div >
<span >等待处理</span>
<el-link type="primary" @click="ListClick" >查看更多>></el-link>
</div>
<div >
<h1 >订单名称:{{item.id}}</h1>
<p >状态:{{item.status_name}}</p>
</div>
<div >
<p >创建时间:{{item.created_at}}</p>
</div>
<div >
<p >账号:{{item.name}}</p>
<el-button type="primary" @click="ListClick" >去审核</el-button>
</div >
</el-carousel-item>
</el-carousel>
</el-card>
<el-card v-if="task_status">
<div >
<h1 >我的订单</h1>
<el-button type="primary" @click="ListClick" >订单列表</el-button>
</div>
<div >
<ul >
<li ><h1 >{{task_status.completed}}</h1><h1 >待审核</h1></li>
<li ><h1 >{{task_status.release}}</h1><h1 >待修改</h1></h1></li>
<li ><h1 >{{task_status.returned}}</h1><h1 >进行中</h1></h1></li>
<li ><h1 >{{task_status.underway}}</h1><h1 >待结算</h1></h1></li>
<li ><h1 >{{task_status.wait_confirm}}</h1><h1 >已完成</h1></li>
<li ><h1 >{{task_status.wait_relevance}}</h1><h1 >已取消</h1></li>
</ul>
</div>
</el-card>
<el-card v-if="order_status&&this.ModeEevent==0">
<div >
<h1 >我的任务</h1>
<el-button type="primary" @click="TaskClick" >任务列表</el-button>
</div>
<div >
<ul >
<li ><h1 >{{order_status.completed}}</h1><h1 >已完成</h1></li>
<li ><h1 >{{order_status.for_the}}</h1><h1 >待修改</h1></li>
<li ><h1 >{{order_status.modify}}</h1><h1 >进行中</h1></li>
<li ><h1 >{{order_status.underway}}</h1><h1 >待结算</h1></li>
<li ><h1 >{{order_status.wait_confirm}}</h1><h1 >已完成</h1></li>
<li ><h1 >{{order_status.underway}}</h1><h1 >已取消</h1></li>
</ul>
</div>
</el-card>
</div>
</template>
<script>
import 'swiper/swiper-bundle.css'
// import style (<= Swiper 5.x)
import 'swiper/swiper.scss'
import {getAction} from "@/api";
import {SET_MODE} from "@/store/mutation-types";
import Vue from "vue";
export default {
name: "Home",
data(){
return{
task1:[],
task_status:{
},
order_status:{
},
order1:[],
ModeEeventCheck:-1,
}
},
computed:{
ModeEevent(){
return this.$store.state.mode
}
},
methods:{
ListClick(){
this.$router.push('/order')
},
TaskClick(){
this.$router.push('/task')
},
},
created() {
console.log(this.ModeEevent)
if(this.ModeEevent==0) {
getAction("/home/market").then(res => {
this.order1=res.data.order
this.task_status=res.data.task_status
this.order_status=res.data.order_status
this.ModeEeventCheck=this.ModeEevent
console.log(res.data.order)
for(var item in this.order1){
console.log(this.order1[item].id)
}
})
}else{
getAction("/home/business").then(res=>{
/*console.log(res)*/
this.task1=res.data.task
this.task_status=res.data.task_status
this.ModeEeventCheck=this.ModeEevent
console.log(res.data.task)
for(var item in this.task1){
console.log(this.task1[item].id)
}
})
}
}
};
</script>
<style scoped>
.el-carousel__item h3 {
color: #475669;
font-size: 18px;
opacity: 0.75;
line-height: 300px;
margin: 0;
}
.el-button{
height: 40px;
}
.el-carousel__item:nth-child(2n) {
background-color: white;
}
.el-carousel__item:nth-child(2n+1) {
background-color: white;
}
</style>