fix: 分享订单页商品明细与订单详情保持一致
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -50,7 +50,8 @@
|
|||||||
<view class="section-title">商品明细</view>
|
<view class="section-title">商品明细</view>
|
||||||
<view class="items-list">
|
<view class="items-list">
|
||||||
<view class="item-row header">
|
<view class="item-row header">
|
||||||
<text class="item-name">商品</text>
|
<text class="item-info">商品信息</text>
|
||||||
|
<text class="item-area">总面积(m²)</text>
|
||||||
<text class="item-qty">数量</text>
|
<text class="item-qty">数量</text>
|
||||||
<text class="item-price">单价</text>
|
<text class="item-price">单价</text>
|
||||||
<text class="item-subtotal">小计</text>
|
<text class="item-subtotal">小计</text>
|
||||||
@@ -60,10 +61,11 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
class="item-row"
|
class="item-row"
|
||||||
>
|
>
|
||||||
<text class="item-name">{{ item.productName }}</text>
|
<text class="item-info"><text class="item-name-text">{{ item.productName }}</text><text class="item-spec-text">{{ item.productSpec ? ' ' + item.productSpec : '' }}</text>\n{{ item.length || '-' }}x{{ item.width || '-' }}</text>
|
||||||
|
<text class="item-area">{{ calcArea(item) }}</text>
|
||||||
<text class="item-qty">{{ item.quantity }}</text>
|
<text class="item-qty">{{ item.quantity }}</text>
|
||||||
<text class="item-price">¥{{ item.price }}</text>
|
<text class="item-price">¥{{ item.price }}</text>
|
||||||
<text class="item-subtotal">¥{{ (item.price * item.quantity).toFixed(2) }}</text>
|
<text class="item-subtotal">¥{{ (item.price * item.quantity).toFixed(0) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -153,6 +155,12 @@ export default {
|
|||||||
formatTime(time) {
|
formatTime(time) {
|
||||||
if (!time) return ''
|
if (!time) return ''
|
||||||
return time.substring(0, 16).replace('T', ' ')
|
return time.substring(0, 16).replace('T', ' ')
|
||||||
|
},
|
||||||
|
calcArea(item) {
|
||||||
|
if (item.length && item.width && item.quantity) {
|
||||||
|
return (item.length * item.width * item.quantity / 1000000).toFixed(4)
|
||||||
|
}
|
||||||
|
return '-'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -284,9 +292,10 @@ export default {
|
|||||||
|
|
||||||
.item-row {
|
.item-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20rpx 0;
|
padding: 16rpx 0;
|
||||||
border-bottom: 1rpx solid #f8f8f8;
|
border-bottom: 1rpx solid #f8f8f8;
|
||||||
font-size: 26rpx;
|
font-size: 24rpx;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-row.header {
|
.item-row.header {
|
||||||
@@ -295,12 +304,32 @@ export default {
|
|||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-name {
|
.item-info {
|
||||||
flex: 2;
|
flex: 3;
|
||||||
|
white-space: pre-line;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-name-text {
|
||||||
|
color: #333;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-spec-text {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-area {
|
||||||
|
flex: 1.2;
|
||||||
|
text-align: center;
|
||||||
|
color: #667eea;
|
||||||
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-qty {
|
.item-qty {
|
||||||
flex: 1;
|
flex: 0.8;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user