This commit is contained in:
Vinjor 2024-11-12 17:35:43 +08:00
parent be7f9cabb4
commit 695f0bf8e2
5 changed files with 231 additions and 26 deletions

View File

@ -175,7 +175,12 @@
<view class="card cardInfo projCard"> <view class="card cardInfo projCard">
<view class="projTitle">维修进度记录表</view> <view class="projTitle">维修进度记录表</view>
<view class="projList"> <view class="projList">
<uni-steps :options="list2" active-color="#007AFF" :active="active" direction="column" /> <view class="tushi-box">
<view class="tushi-item" style="color: #B7BDC6">待维修 </view>
<view class="tushi-item" style="color: #E8A321">维修中 </view>
<view class="tushi-item" style="color: #2979FF;">已完成</view>
</view>
<uni-steps :options="list2" active-color="#007AFF" :active="active" :doingActive="doingActive" @prviewImage="prviewImage" direction="column" />
</view> </view>
</view> </view>
<view class="card cardInfo projCard"> <view class="card cardInfo projCard">
@ -184,11 +189,14 @@
<template> <template>
<view v-for="item in ticketInfo.records" :key="item.id" class="projItem"> <view v-for="item in ticketInfo.records" :key="item.id" class="projItem">
<view class="projTop"> <view class="projTop">
<text class="projName">{{item.type }}{{item.dealUserName}}</text> <text class="projName">{{item.type }}{{item.roleName}}-{{item.dealUserName}}</text>
<!-- <text class="projAmount">${{ item.amount }}</text>--> <!-- <text class="projAmount">${{ item.amount }}</text>-->
</view> </view>
<view class="projBody"> <view class="projBody">
<view class="projDate"> <view class="projDate" style="padding: 10rpx 0 0 0" v-if="item.projectName">
<text class="projDateText">本次维修项目{{ item.projectName }}</text>
</view>
<view class="projDate" style="padding: 10rpx 0">
<image mode="aspectFit" src="/static/icons/date.png" style="width: 24rpx;height: 24rpx"></image> <image mode="aspectFit" src="/static/icons/date.png" style="width: 24rpx;height: 24rpx"></image>
<text class="projDateText">{{ item.createTime }}</text> <text class="projDateText">{{ item.createTime }}</text>
</view> </view>
@ -236,9 +244,9 @@
carInfo: {}, carInfo: {},
userInfo: {}, userInfo: {},
imgUrlPrex:config.baseImageUrl, imgUrlPrex:config.baseImageUrl,
active: -1,
doingActive: -1,
// //
tableData:[],
active: 1,
list2: [], list2: [],
}; };
}, },
@ -305,9 +313,12 @@
let thisObj = res.data[i] let thisObj = res.data[i]
thisObj.title = thisObj.itemName thisObj.title = thisObj.itemName
if(thisObj.itemStatus=='03'){ if(thisObj.itemStatus=='03'){
//, //,
endIndex = i endIndex = i
thisObj.desc = formatTimestamp(thisObj.updateTime) thisObj.desc = formatTimestamp(thisObj.updateTime)
}else if(thisObj.itemStatus=='02'){
//
this.doingActive = i
} }
this.list2.push(thisObj) this.list2.push(thisObj)
} }
@ -583,6 +594,7 @@
gap: 20rpx; gap: 20rpx;
.tushi-box{ .tushi-box{
font-size: 16px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@ -0,0 +1,18 @@
## 1.1.22024-03-28
- 修复 uni-steps为竖排列时文本长度过长引起点错乱的bug
## 1.1.12021-11-22
- 修复 vue3中某些scss变量无法找到的问题
## 1.1.02021-11-19
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-steps](https://uniapp.dcloud.io/component/uniui/uni-steps)
## 1.0.82021-05-12
- 新增 项目示例地址
## 1.0.72021-05-06
- 修复 uni-steps 横向布局时,多行文字高度不合理的 bug
## 1.0.62021-04-21
- 优化 添加依赖 uni-icons, 导入后自动下载依赖
## 1.0.52021-02-05
- 优化 组件引用关系通过uni_modules引用组件
## 1.0.42021-02-05
- 调整为uni_modules目录规范

View File

@ -4,10 +4,27 @@
<view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']"> <view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
<view v-for="(item,index) in options" :key="index" <view v-for="(item,index) in options" :key="index"
:class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']"> :class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
<text :style="{color:index === active?activeColor:deactiveColor}" <text v-if="doingActive==index" :style="{color:doingColor}"
:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
<text v-else :style="{color:index <= active?activeColor:deactiveColor}"
:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text> :class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
<text v-if="item.desc" :style="{color: deactiveColor}" <text v-if="item.desc" :style="{color: deactiveColor}"
:class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text> :class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text>
<template >
<view class="projImg" v-if="item.recordsItemList.length>0">
<image v-for="(img, imgIndex) in item.recordsItemList" @click="prviewImage(item.recordsItemList,imgIndex)" :key="imgIndex" :src="imgUrlPrex + img.image"
class="projImgItem"></image>
</view>
<view class="projSend" v-if="item.recordsItemList.length>0 && canOpenCus">
<template >
<uni-icons v-if="doingActive==index" type="cloud-upload" size="18" :style="{color:doingColor}"></uni-icons>
<uni-icons v-else type="cloud-upload" size="18" :style="{color:index <= active?activeColor:deactiveColor}"></uni-icons>
<!-- <image mode="aspectFit" src="@/static/icons/send.png" class="projIcon" :style="{color:index <= active?activeColor:deactiveColor}"></image>-->
<text v-if="doingActive==index" :style="{color: doingColor}" @click="sendCusImgManage(item.recordsItemList)">发送给客户</text>
<text v-else :style="{color:index <= active?activeColor:deactiveColor}" @click="sendCusImgManage(item.recordsItemList)">发送给客户</text>
</template>
</view>
</template>
</view> </view>
</view> </view>
<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']"> <view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
@ -17,12 +34,18 @@
:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']" :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--before':'uni-steps__row-line--before']"
:style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}"> :style="{backgroundColor:index<=active&&index!==0?activeColor:index===0?'transparent':deactiveColor}">
</view> </view>
<view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']" <!-- <view :class="[direction==='column'?'uni-steps__column-check':'uni-steps__row-check']"-->
v-if="index === active"> <!-- v-if="index === active">-->
<uni-icons :color="activeColor" :type="activeIcon" size="20" /> <!-- <uni-icons :color="activeColor" :type="activeIcon" size="20" />-->
<!-- </view>-->
<view v-if="doingActive==index" :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"
:style="{backgroundColor:doingColor}" >
<text style="font-size: 16px;color: white">{{index+1}}</text>
</view> </view>
<view v-else :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']" <view v-else :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"
:style="{backgroundColor:index<active?activeColor:deactiveColor}" /> :style="{backgroundColor:index<=active?activeColor:deactiveColor}" >
<text style="font-size: 16px;color: white">{{index+1}}</text>
</view>
<view <view
:class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']" :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
:style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" /> :style="{backgroundColor:index<active&&index!==options.length-1?activeColor:index===options.length-1?'transparent':deactiveColor}" />
@ -44,7 +67,7 @@
* @property {String} activeColor 选中状态的颜色 * @property {String} activeColor 选中状态的颜色
* @property {Array} options 数据源格式为[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}] * @property {Array} options 数据源格式为[{title:'xxx',desc:'xxx'},{title:'xxx',desc:'xxx'}]
*/ */
import config from '@/config'
export default { export default {
name: 'UniSteps', name: 'UniSteps',
props: { props: {
@ -53,6 +76,11 @@
type: String, type: String,
default: 'row' default: 'row'
}, },
canOpenCus: {
//
type: Boolean,
default: false
},
activeColor: { activeColor: {
// //
type: String, type: String,
@ -63,10 +91,20 @@
type: String, type: String,
default: '#B7BDC6' default: '#B7BDC6'
}, },
doingColor: {
//
type: String,
default: '#E8A321'
},
active: { active: {
// //
type: Number, type: Number,
default: 0 default: -1
},
doingActive: {
//
type: Number,
default: -1
}, },
activeIcon: { activeIcon: {
// //
@ -83,6 +121,7 @@
data() { data() {
return { return {
heightArr: [], heightArr: [],
imgUrlPrex:config.baseImageUrl,
} }
}, },
mounted() { mounted() {
@ -95,6 +134,14 @@
}).exec() }).exec()
} }
}, },
methods:{
prviewImage(itemList,index){
this.$emit("prviewImage",itemList,index)
},
sendCusImgManage(itemList){
this.$emit("sendCusImgManage",itemList)
},
}
} }
</script> </script>
@ -164,15 +211,15 @@
} }
.uni-steps__row-title { .uni-steps__row-title {
font-size: 14px; font-size: 28rpx;
line-height: 16px; line-height: 32rpx;
text-align: center; text-align: center;
} }
.uni-steps__column-title { .uni-steps__column-title {
font-size: 18px; font-size: 28rpx;
text-align: left; text-align: left;
line-height: 24px; line-height: 32rpx;
} }
.uni-steps__row-desc { .uni-steps__row-desc {
@ -182,9 +229,9 @@
} }
.uni-steps__column-desc { .uni-steps__column-desc {
font-size: 16px; font-size: 25rpx;
text-align: left; text-align: left;
line-height: 20px; line-height: 32rpx;
} }
.uni-steps__row-container { .uni-steps__row-container {
@ -253,16 +300,17 @@
} }
.uni-steps__row-circle { .uni-steps__row-circle {
width: 15px; width: 20px;
height: 15px; height: 20px;
border-radius: 50%; border-radius: 50%;
background-color: #B7BDC6; background-color: #B7BDC6;
margin: 0px 3px; margin: 0px 3px;
} }
.uni-steps__column-circle { .uni-steps__column-circle {
width: 15px; width: 20px;
height: 15px; height: 20px;
text-align: center;
border-radius: 50%; border-radius: 50%;
background-color: #B7BDC6; background-color: #B7BDC6;
margin: 4px 0px 5px 0px; margin: 4px 0px 5px 0px;
@ -277,4 +325,31 @@
line-height: 14px; line-height: 14px;
margin: 2px 0px; margin: 2px 0px;
} }
.projImg {
width: 100%;
display: grid;
grid-template-columns: repeat(auto-fill, 120rpx);
justify-content: space-between;
gap: 20rpx;
padding: 20rpx 0;
.projImgItem {
width: 120rpx;
height: 120rpx;
background-color: #efefef;
}
}
.projSend {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
column-gap: 8rpx;
}
.projIcon{
width: 28rpx;
height: 28rpx;
}
</style> </style>

View File

@ -0,0 +1,87 @@
{
"id": "uni-steps",
"displayName": "uni-steps 步骤条",
"version": "1.1.2",
"description": "步骤条组件,提供横向和纵向两种布局格式。",
"keywords": [
"uni-ui",
"uniui",
"步骤条",
"时间轴"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@ -0,0 +1,13 @@
## Steps 步骤条
> **组件名uni-steps**
> 代码块: `uSteps`
步骤条,常用于显示进度
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-steps)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839