Commit c817cb8e by zhangxw

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

1 parent 836c9ae8
...@@ -295,6 +295,9 @@ Page({ ...@@ -295,6 +295,9 @@ Page({
data.customer.customerCarName = data.customer.carSeriesName data.customer.customerCarName = data.customer.carSeriesName
? `${data.customer.carBrand}-${data.customer.carChildsBrandName}-${data.customer.carSeriesName}` ? `${data.customer.carBrand}-${data.customer.carChildsBrandName}-${data.customer.carSeriesName}`
: '' : ''
if (data.customer?.customerName) {
this.limitTwoLines(data.customer?.customerName)
}
this.setData( this.setData(
{ {
detailInfo: data || {}, detailInfo: data || {},
...@@ -319,6 +322,17 @@ Page({ ...@@ -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() { handleOutbound() {
this.setData( this.setData(
......
...@@ -43,35 +43,14 @@ page { ...@@ -43,35 +43,14 @@ page {
} }
.staff-name { .staff-name {
position: relative;
background: none; background: none;
max-width: var(--fontSize242); max-width: var(--fontSize242);
display: inline-block;
&::before { background: #2979ff;
content: "("; color: #fff;
position: absolute; line-height: 1.4;
left: 0; word-break: break-all;
top: 0; white-space: normal;
}
&::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;
}
} }
margin-bottom: var(--fontSize32); margin-bottom: var(--fontSize32);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<image wx:if="{{detailInfo.constructionStatus != 0}}" src="{{IMG_URL}}repair-order/complete.png" mode="" />{{detailInfo.customer.carSeriesName || '无车型客户'}} <image wx:if="{{detailInfo.constructionStatus != 0}}" src="{{IMG_URL}}repair-order/complete.png" mode="" />{{detailInfo.customer.carSeriesName || '无车型客户'}}
</view> </view>
<view class="staff-name"> <view class="staff-name">
<text class="name">{{detailInfo.customer.customerName || '-'}}</text> <text class="name">{{displayCustomerName || '-'}}</text>
</view> </view>
</view> </view>
<block wx:if="{{detailInfo.constructionStatus == 0}}"> <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!