Commit c817cb8e by zhangxw

施工单顶部客户姓名换行样式修改

1 parent 836c9ae8
......@@ -295,6 +295,9 @@ Page({
data.customer.customerCarName = data.customer.carSeriesName
? `${data.customer.carBrand}-${data.customer.carChildsBrandName}-${data.customer.carSeriesName}`
: ''
if (data.customer?.customerName) {
this.limitTwoLines(data.customer?.customerName)
}
this.setData(
{
detailInfo: data || {},
......@@ -319,6 +322,17 @@ Page({
})
},
// 客户名称括号处理
limitTwoLines(customerName) {
const text = customerName
const maxLength = 14
let displayCustomerName = `(${text})`
if (text.length > maxLength) {
displayCustomerName = `(${text.slice(0, maxLength)}...)`
}
this.setData({ displayCustomerName })
},
// 物料出库
handleOutbound() {
this.setData(
......
......@@ -43,35 +43,14 @@ page {
}
.staff-name {
position: relative;
background: none;
max-width: var(--fontSize242);
&::before {
content: "(";
position: absolute;
left: 0;
top: 0;
}
&::after {
content: ")";
position: absolute;
right: 0;
bottom: 0;
}
.name {
padding-right: 1.2em;
text-indent: 1.2em;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/* 限制显示两行 */
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
}
display: inline-block;
background: #2979ff;
color: #fff;
line-height: 1.4;
word-break: break-all;
white-space: normal;
}
margin-bottom: var(--fontSize32);
......
......@@ -9,7 +9,7 @@
<image wx:if="{{detailInfo.constructionStatus != 0}}" src="{{IMG_URL}}repair-order/complete.png" mode="" />{{detailInfo.customer.carSeriesName || '无车型客户'}}
</view>
<view class="staff-name">
<text class="name">{{detailInfo.customer.customerName || '-'}}</text>
<text class="name">{{displayCustomerName || '-'}}</text>
</view>
</view>
<block wx:if="{{detailInfo.constructionStatus == 0}}">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!