Refactor(云灵AI):订单列表数据对接

This commit is contained in:
lifizer
2026-04-16 15:39:14 +08:00
parent e0ba6f7422
commit bf3a18cb4b
2 changed files with 38 additions and 34 deletions
+37 -33
View File
@@ -10,7 +10,7 @@
class="icon"
mode="widthFix"
/>
{{ item.shopName }}
{{ item.merName }}
</view>
<view class="order-id">
{{ item.orderId }}
@@ -20,35 +20,41 @@
{{ item.statusName }}
</view>
</view>
<view class="product-info">
<view class="good-img">
<image
:src="item.img"
class="img"
mode="widthFix"
/>
</view>
<view class="name-wrap">
<view class="name one-t">
{{ item.name }}
<view class="product-info-wrap">
<view
v-for="cartItem in item.cartInfo"
:key="cartItem.productId"
class="product-info"
>
<view class="good-img">
<image
:src="cartItem.productInfo.image"
class="img"
mode="widthFix"
/>
</view>
<view class="attr">
{{ item.attr || '' }}
<view class="name-wrap">
<view class="name one-t">
{{ cartItem.productInfo.storeName }}
</view>
<view class="attr">
规格{{ cartItem.productInfo.attrInfo.sku || '' }}
</view>
</view>
</view>
<view class="price-num">
<view>
{{ item.price }}
</view>
<view class="num">
x{{ item.num }}
<view class="price-num">
<view>
{{ cartItem.truePrice }}
</view>
<view class="num">
x{{ cartItem.cartNum }}
</view>
</view>
</view>
</view>
<view class="order-bottom">
<view class="time-total">
<view class="time">
{{ item.createTime }}
{{ formatDateTime(item.createTime) }}
</view>
<view class="total">
{{ item.totalNum }}件商品
@@ -65,6 +71,7 @@
</template>
<script>
import { formatDateTime } from '@/utils/index'
export default {
name: 'AiHistoryList',
props: {
@@ -79,6 +86,7 @@ export default {
}
},
methods: {
formatDateTime,
viewOrderTrack() {
this.$emit('viewOrderTrack', this.item)
}
@@ -126,13 +134,13 @@ export default {
font-size: 24rpx;
line-height: 40rpx;
text-align: center;
background: rgba(197,39,51,0.39);
background: rgba(197,39,51,1);
}
}
.product-info {
display: flex;
align-items: center;
justify-content: space-around;
justify-content: space-between;
padding: 20rpx 0;
font-size: 28rpx;
.good-img {
@@ -144,30 +152,26 @@ export default {
}
}
.name-wrap {
display: flex;
flex-direction: column;
height: 120rpx;
width: calc(100% - 240rpx);
width: calc(100% - 260rpx);
.name {
line-height: 40rpx;
}
.attr {
display: flex;
flex-wrap: wrap;
display: inline-block;
min-height: 50rpx;
padding: 0 25rpx;
margin: 20rpx 0 0 0;
border-radius: 25rpx;
line-height: 40rpx;
line-height: 50rpx;
color: #252525;
line-height: 40rpx;
background: rgba(239,239,239,0.39);
}
}
.price-num {
width: 100rpx;
text-align: right;
line-height: 40rpx;
.price {
}
.num {
font-size: 20rpx;
}
+1 -1
View File
@@ -56,7 +56,7 @@ export function dateFormatT(time) {
* @param format {String} 格式(例:yyyy-MM-dd
*/
export function formatDateTime(time, format) {
export function formatDateTime(time, format = 'yyyy-MM-dd HH:mm:ss') {
var t = new Date(time);
var tf = function (i) {
return (i < 10 ? "0" : "") + i;