工作244:根据页面的内容调用

1根据内容接口判断接口数据

2显示不同的内容

3状态管理

<!--首页管理-->
<template><div><!--market--><el-card   v-if="task1.length!=0" style="width: 100%;height: 300px;"><el-carousel :interval="3000" indicator-position="outside"><el-carousel-item v-for="(item,index) in task1" :key="index"><div style="display: flex;justify-content: space-between;"><span style="float:left;margin-top: 40px;width: 86px;font-size: 16px;margin-left: 10%">等待处理</span><el-link type="primary" @click="ListClick" style="margin-right: 10%">查看更多>></el-link></div><div style="clear: both"><h1 style="margin-top:10px;float:left;margin-left:32px;width: 423px;height: 26px;;font-weight: bold;font-size: 20px;margin-left: 10%">订单名称:{{item.id}}</h1><p style="margin-top: 20px;font-size: 21px;margin-left:32px;font-size: 16px;float: right;margin-right: 10%;">状态:{{item.status_name}}</p></div><div style="clear: both"><p style="float:left;width: 275px;height: 21px;font-size: 14px;color: #707070;margin-left: 10%;">创建时间:{{item.created_at}}</p></div><div style="clear: both;display: flex;justify-content: space-between;"><p style="float:left;width: 275px;height: 21px;font-size: 16px;margin-left:10%;">账号:{{item.account.name}}</p><el-button type="primary" style="width: 98px;margin-right: 10%;" @click="ListClick" >去审核</el-button></div ></el-carousel-item></el-carousel></el-card><el-card  v-if="order1.length!=0"  style="width: 100%;height: 300px;"><el-carousel :interval="3000" indicator-position="outside"><el-carousel-item v-for="(item,index) in order1" :key="index"><div style="display: flex;justify-content: space-between;"><span style="float:left;margin-top: 40px;width: 86px;font-size: 16px;margin-left: 10%">等待处理</span><el-link type="primary" @click="ListClick" style="margin-right: 10%">查看更多>></el-link></div><div style="clear: both"><h1 style="margin-top:10px;float:left;margin-left:32px;width: 423px;height: 26px;;font-weight: bold;font-size: 20px;margin-left: 10%">订单名称:{{item.id}}</h1><p style="margin-top: 20px;font-size: 21px;margin-left:32px;font-size: 16px;float: right;margin-right: 10%;">状态:{{item.status_name}}</p></div><div style="clear: both"><p style="float:left;width: 275px;height: 21px;font-size: 14px;color: #707070;margin-left: 10%;">创建时间:{{item.created_at}}</p></div><div style="clear: both;display: flex;justify-content: space-between;"><p style="float:left;width: 275px;height: 21px;font-size: 16px;margin-left:10%;">账号:{{item.name}}</p><el-button type="primary" style="width: 98px;margin-right: 10%;" @click="ListClick" >去审核</el-button></div ></el-carousel-item></el-carousel></el-card><el-card v-if="task_status"><div style="display: flex;justify-content: space-between"><h1 style="float: left;margin-top: 34px;margin-left: 32px;">我的订单</h1><el-button    type="primary" @click="ListClick" >订单列表</el-button></div><div  style="width: 100%;clear: both;display: flex;justify-content: center"><ul  style="float:left;width: 100%;"><li style="float:left;list-style: none;border-right:1px solid  #000000;;width: 16%;text-align: center"><h1 style="font-size:30px;text-align: center">{{task_status.completed}}</h1><h1 style="font-size:20px;text-align: center;">待审核</h1></li><li style="float:left;list-style: none;border-right:1px solid  #000000;width: 16%;text-align: center"><h1 style="font-size:30px;text-align: center">{{task_status.release}}</h1><h1 style="font-size:20px;text-align: center;">待修改</h1></h1></li><li style="float:left;list-style: none;border-right:1px solid  #000000;width: 16%;text-align: center"><h1 style="font-size:30px;text-align: center">{{task_status.returned}}</h1><h1 style="font-size:20px;text-align: center;">进行中</h1></h1></li><li style="float:left;list-style: none;border-right:1px solid  #000000;width: 16%;text-align: center"><h1 style="font-size:30px;text-align: center">{{task_status.underway}}</h1><h1 style="font-size:20px;text-align: center;">待结算</h1></h1></li><li style="float:left;list-style: none;border-right:1px solid  #000000;width: 16%;text-align: center"><h1 style="font-size:30px;text-align: center">{{task_status.wait_confirm}}</h1><h1 style="font-size:20px;text-align: center;">已完成</h1></li><li style="float:left;list-style: none;border-right:none;width: 16%;text-align: center"><h1 style="font-size:30px;text-align: center">{{task_status.wait_relevance}}</h1><h1 style="font-size:20px;text-align: center;">已取消</h1></li></ul></div></el-card><el-card v-if="order_status&&this.ModeEevent==0"><div style="display: flex;justify-content: space-between"><h1 style="float: left;margin-top: 34px;margin-left: 32px;">我的任务</h1><el-button  type="primary" @click="TaskClick" >任务列表</el-button></div><div  style="width: 100%;clear: both;display: flex;justify-content: center"><ul  style="float:left;width: 100%;"><li style="float:left;list-style: none;width: 16%;border-right:1px solid  #000000;text-align: center"><h1  style="font-size:30px;text-align: center">{{order_status.completed}}</h1><h1 style="font-size:20px;text-align: center;">已完成</h1></li><li style="float:left;list-style: none;width: 16%;border-right:1px solid  #000000;text-align: center"><h1 style="font-size:30px;text-align: center">{{order_status.for_the}}</h1><h1 style="font-size:20px;text-align: center;">待修改</h1></li><li style="float:left;list-style: none;width: 16%;border-right:1px solid  #000000;text-align: center"><h1 style="font-size:30px;text-align: center">{{order_status.modify}}</h1><h1 style="font-size:20px;text-align: center;">进行中</h1></li><li style="float:left;list-style: none;width: 16%;border-right:1px solid  #000000;text-align: center"><h1 style="font-size:30px;text-align: center">{{order_status.underway}}</h1><h1 style="font-size:20px;text-align: center;">待结算</h1></li><li style="float:left;list-style: none;width: 16%;border-right:1px solid  #000000;text-align: center"><h1 style="font-size:30px;text-align: center">{{order_status.wait_confirm}}</h1><h1 style="font-size:20px;text-align: center;">已完成</h1></li><li style="float:left;list-style: none;width: 16%;border-right:none;;text-align: center"><h1 style="font-size:30px;text-align: center">{{order_status.underway}}</h1><h1 style="font-size:20px;text-align: center;">已取消</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.orderthis.task_status=res.data.task_statusthis.order_status=res.data.order_statusthis.ModeEeventCheck=this.ModeEeventconsole.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.taskthis.task_status=res.data.task_statusthis.ModeEeventCheck=this.ModeEeventconsole.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>

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/414582.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Android 换肤demo,轻量快捷接入集成,判断是否夜间模式

true为黑夜模式 //检查当前系统是否已开启暗黑模式 public static boolean getDarkModeStatus(Context context) {int mode context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;return mode Configuration.UI_MODE_NIGHT_YES;} 实现…

Python——使用matplotlib绘制柱状图

Python——使用matplotlib绘制柱状图 1、基本柱状图 首先要安装matplotlib&#xff08;http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.plot&#xff09; 可以使用pip命令直接安装[python] view plaincopy # -*- coding: utf-8 -*- import matplotlib.pyplot a…

了解 yarn 、npm、nodejs

了解 yarn 、npm、nodejs 一、前言 针对即将上线的 jeecg-boot 做一些准备。二、了解系列 1、了解 nodejs Node.js 就是运行在服务端的 JavaScript。Node.js 是一个基于Chrome JavaScript 运行时建立的一个平台。Node.js是一个事件驱动I/O服务端JavaScript环境&#xff0c;基于…

Android 语音播报,语音识别demo

该功能是基于百度智能云实现的根据文字进行语音播报。 1、首先到百度智能云创建语音应用 https://console.bce.baidu.com/ai/ 填写包名创建百度语音应用&#xff0c;获取AppID&#xff0c;API Key&#xff0c;Secret Key 2、导入资源文件。语音jar&#xff0c;assets语音库&am…

jeecg自定义datagrid查询

jeecg自定义datagrid查询 为什么要写这篇文章&#xff1f; 我们了解&#xff0c;使用 jeecg 提供的 CriteriaQuery 查询方式&#xff0c;确实能满足绝大数的需求&#xff0c;但是往往有那么个比较复杂的情况&#xff0c;需要我们直接去写 sql&#xff0c;比如多表查询呀等等等…

mailto发送邮件

mailto后面加发送邮件地址&#xff0c;可以在网页上通过链接直接打开邮件客户端发送邮件&#xff1b;只有第一个可以 1 <!DOCTYPE html>2 <html>3 <head>4 <meta charset"UTF-8">5 <title></title>6 &l…

Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jre7:1.3.21

第一次在Android studio 创建kotlin项目。编译报错&#xff1a; Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jre7:1.3.21 解决方法 // implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"implementation "org.jetbrai…

jeecg自定义按钮使用exp属性不起作用

jeecg自定义按钮使用exp属性不起作用 为什么要写这篇文章&#xff1f; 之前写过一篇类似的文章 jeecg笔记之自定义显示按钮exp属性&#xff0c;但是有些小伙伴留言参考后不起作用&#xff0c;当时我的 jeecg 版本为3.7.5&#xff0c;最终以版本不同&#xff0c;暂时搁浅了。今…

使用java修改图片DPI

修改以后可以直接用PS打开看效果 全部使用rt下的类&#xff0c;无需下载其他jar包 import com.sun.image.codec.jpeg.JPEGCodec; import com.sun.image.codec.jpeg.JPEGEncodeParam; import com.sun.image.codec.jpeg.JPEGImageEncoder; import javax.imageio.ImageIO; …

Android studio 创建kotlin工程

1、安装kotlin插件 打开settings页面。安装插件 2、已安装kotlin插件即可创建kotlin项目 打开New Project。选中Includ Kotlin support即可 3、创建kotlin或者java的activity 选中语音类型kotlin或者java kotlin项目创建完成 kotlin工程demo链接&#xff1a;https://download…

改造一下jeecg中的部门树

改造一下jeecg中的部门树 假装有需求 关于 jeecg 提供的部门树&#xff0c;相信很多小伙伴都已经用过了&#xff0c;今天假装有那么一个需求 "部门树弹窗选择默认展开下级部门"&#xff0c;带着这个需求再次去探索一下吧。 一、改造之前的部门选择树流程 1.1 t:depa…

html 知识

一 html是什么&#xff1f; ,1、超文本标记语言&#xff08;Hypertext Markup Language, HTML&#xff09;是一种用于创建网页的标记语言。 2、本质上是浏览器可识别的规则&#xff0c;我们按照规则写网页&#xff0c;浏览器根据规则渲染我们的网页。对于不同的浏览器&#xff…

Android kotlin基础语法

1、继承类和实现接口 继承类是冒号连接&#xff0c;java是extends连接。实现接口是逗号连接&#xff0c;java是implements连接 class MainActivity : AppCompatActivity(),MyKotlinInterface ,MyInterface{ java&#xff1a;public class Main3Activity extends AppCompatAc…

工作245:vue的注意规范之v-if 与 v-for 一起使用

当 v-if 与 v-for 一起使用时&#xff0c;v-for 具有比 v-if 更高的优先级&#xff0c;这意味着 v-if 将分别重复运行于每个 v-for 循环中 所以&#xff0c;不推荐v-if和v-for同时使用 使用推荐方式&#xff1a; 或者&#xff1a;放在计算属性遍历 当它们处于同一节点&#x…

Django create_user with is_active=False

Django create_user with is_activeFalse 下面的内容来自官方文档is_active布尔值。指示用户的账号是否激活。我们建议把这个标记设置为False 来代替删除账号&#xff1b;这样的话&#xff0c;如果你的应用和User 之间有外键关联&#xff0c;外键就不会失效。 它不是用来控制用…

Android kotlin实现底部导航栏

1、实现效果&#xff0c;可点击或者滑动切换fragment 点击 滑动 实现方法&#xff1a; 1、创建三个fragment.kt 2、创建fragmentAdapter class MyFragmentAdapter(fragmentManage…