当前位置: 首页 > news >正文

uni-app纵向步骤条

分享一下项目中自封装的步骤条,存个档~
1. 话不多说,先看效果

2. 话还不多说,上代码
<template><!-- 获取一个数组,结构为[{nodeName:"流程发起"isAudit:falsetime:"2024-02-04 14:27:35"otherData:{assignee:{userId:"465"name:"XXX"company:"测试产业单位1"tenantId:"140"}}] --><view class="bg"><view class="steps"><view class="steps_item" v-for="(i, index) in infoList" :key="index"><view class="s_r"><view class="line" :style="{ backgroundColor: index != 0 ? '#EAEAEA' : 'rgba(0,0,0,0)' }"></view><view class="index" :style="{ backgroundColor: backgroundColor, color: color }"></view><viewclass="line":style="{ backgroundColor: index != infoList.length - 1 ? '#EAEAEA' : 'rgba(0,0,0,0)' }"></view></view><view class="s_l"><view class="info_item"><!-- 真是节点名称、时间 --><view class="top_info"><view class="title">{{ i.nodeName }}</view><view class="date">{{ i.time }}</view></view><view class="info"><!-- 是否为审批节点,审批节点可显示审批状态 --><template v-if="i.isAudit"><viewclass="audit-status"v-if="i.status === '1'":style="`background-color:${auditStatus(2).bgColor};color:${auditStatus(2).color}`">{{ auditStatus(2).text }}</view><viewclass="audit-status"v-else:style="`background-color:${auditStatus(3).bgColor};color:${auditStatus(3).color}`">{{ auditStatus(3).text }}</view></template><!-- 是否有其他信息需要展示,如审批人、签名、原因等 --><template v-if="i.otherData"><view class="text-grey" v-if="i.otherData.assignee">{{ i.otherData.assignee.name }} <text class="ml5"></text>{{ i.otherData.assignee.company }}</view><view class="mt10" v-if="i.otherData.sign"><imagestyle="width: 320rpx"mode="widthFix":src="i.otherData.sign"@click="handlePreview(i.otherData.sign)"/></view><view class="text-grey mt10" v-if="i.otherData.comment"> 原因:{{ i.otherData.comment }} </view></template></view></view></view></view></view></view>
</template><script>
export default {name: 'YSteps',props: {infoList: {type: Array,default: [],},color: {type: String,default: '#fff',},backgroundColor: {type: String,default: '#ff3838',},lineNum: {type: Number,default: 0,},},methods: {// 审核状态auditStatus(i) {if (i == 2) {return {text: '通过',color: '#00D288',bgColor: '#EAFFF8',}} else if (i == 3) {return {text: '驳回',color: '#FF4141',bgColor: '#FFDCD5',}}},handlePreview(url) {uni.previewImage({ urls: [url] })},},
}
</script><style lang="scss" scoped>
.steps {display: flex;flex-direction: column;.steps_item {display: flex;.s_r {padding: 0 20rpx;display: flex;flex-direction: column;align-items: center;.line {flex: 1;width: 5rpx;border-left: 4rpx dashed #fff;}.index {width: 24rpx;height: 24rpx;border-radius: 50rpx;border: 4rpx solid #e3eeff;box-sizing: border-box;}}.s_l {display: flex;flex-direction: column;padding: 20rpx 0;flex: 1;.info_item {background-color: #ffffff;margin-right: 30rpx;border-radius: 10rpx;display: flex;flex-direction: column;justify-content: center;padding: 30rpx 0;.top_info {display: flex;align-items: center;justify-content: space-between;}text {font-size: 24rpx;font-weight: 500;color: rgba(51, 51, 51, 1);}.title {width: calc(100vw - 330rpx);font-size: 28rpx;font-weight: 500;color: rgba(102, 102, 102, 1);overflow: hidden;text-overflow: ellipsis;display: -webkit-box;flex-direction: column;}.info {font-size: 24rpx;color: #afb4be;margin-top: 10rpx;}.date {font-size: 23rpx;color: #afb4be;}.audit-status {float: right;width: 120rpx;height: 40rpx;line-height: 40rpx;text-align: center;font-size: 22rpx;background: #eafff8;border-radius: 20rpx;}}.info_item:active {background-color: #f4f4f4;}}}
}
.ml5 {margin-left: 10rpx;
}
.mt10 {margin-top: 20rpx;
}
</style>

http://www.lryc.cn/news/327085.html

相关文章:

  • 【JavaEE -- 文件操作IO有关面试题】
  • Open WebUI大模型对话平台-适配Ollama
  • [2021]Zookeeper getAcl命令未授权访问漏洞概述与解决
  • vscode添加gitee
  • 数据库底层原理
  • JVM虚拟机-实战篇
  • 上岸跨考生的备考经验,送给零基础跨考计算机的你!
  • js改变图片曝光度(高亮度)
  • 【NLP笔记】大模型prompt推理(提问)技巧
  • 【目标检测】西红柿成熟度数据集三类标签原始数据集280张
  • Java File类(文件操作类)
  • 正则表达式 vs. 字符串处理:解析优势与劣势
  • 1、goreplay流量回放
  • Transformer的前世今生 day06(Self-Attention和RNN、LSTM的区别)
  • UDP send 出现大量“Resource temporarily unavailable”
  • 怎么拆解台式电脑风扇CPU风扇的拆卸步骤-怎么挑
  • Windows安装Odoo结合内网穿透实现公网访问本地企业管理系统
  • Portainer的替代Dockge?又一个Docker Compose管理器?
  • Midjourney AI绘图工具介绍及使用
  • clang-query 的编译安装与使用示例
  • echarts数据下钻如何配置
  • git 提交空目录
  • 【优化方案】Java 将字符串中的星号替换为0-9中的数字,并返回所有可能的替换结果
  • C语言复习-链表
  • Redis面试题-缓存雪崩、缓存穿透、缓存击穿问题
  • 【Node.js】npx
  • hive授予指定用户特定权限及beeline使用
  • Vmware虚拟机无法用root直连说明
  • Visio中存在问题的解决方法
  • taro之Swiper的使用