Files
xdd-uniapp-new/aiChat/components/orderItem.vue
T

264 lines
5.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view
class="order-item"
>
<view class="order-header">
<view class="order-shop">
<view class="shop-name">
<image
:src="webUrl + '/aiChat/icon-57.png'"
class="icon"
mode="widthFix"
lazy-load
/>
{{ item.merName }}
</view>
<view class="order-id">
订单号{{ item.orderId }}
</view>
</view>
<view class="status">
{{ item.statusName }}
</view>
</view>
<view v-if="item.isGiftCardReceiveBlind === 0" 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"
lazy-load
/>
</view>
<view class="name-wrap">
<view class="name one-t">
{{ cartItem.productInfo.storeName }}
</view>
<view class="attr">
规格{{ cartItem.productInfo.attrInfo.sku || '' }}
</view>
</view>
<view class="price-num">
<view>
{{ cartItem.payPrice }}
</view>
<view class="num">
x{{ cartItem.cartNum }}
</view>
</view>
</view>
</view>
<view v-else class="product-info-wrap">
<view
class="product-info product-info2"
>
<view class="good-img">
<image
:src="webUrl + '/orderIcon/盲盒礼包.png'"
class="img"
mode="widthFix"
lazy-load
/>
</view>
<view class="name-wrap">
<view class="name one-t">
盲盒礼物
</view>
<view class="attr">
待收货后展示商品信息
</view>
</view>
<view class="price-num">
<view style="color: #fff;">
0.00
</view>
<view class="num">
x1
</view>
</view>
</view>
</view>
<view class="order-bottom">
<view class="time-total">
<view class="time">
{{ formatDateTime(item.createTime) }}
</view>
<view class="total">
{{ item.totalNum }}件商品
<text v-if="item.isGiftCardReceiveBlind === 0" class="total-txt">
&nbsp;&nbsp;&nbsp;&nbsp;总金额<text class="color-red">{{ item.totalPrice }}</text>
</text>
</view>
</view>
<view class="btns">
<view class="btn" @click="viewOrderTrack">查看物流</view>
</view>
</view>
</view>
</template>
<script>
import { formatDateTime } from '@/utils/index'
export default {
name: 'AiHistoryList',
props: {
item: {
type: Object,
default: () => {}
}
},
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL
}
},
methods: {
formatDateTime,
viewOrderTrack() {
this.$emit('viewOrderTrack', this.item)
}
}
}
</script>
<style scoped lang="less">
.order-item {
padding: 20rpx;
border-radius: 20rpx;
background-color: #fff;
box-shadow: 0rpx 6rpx 20rpx rgba(101,101,101,0.16);
.order-header {
display: flex;
align-items: center;
justify-content: space-between;
.order-shop {
flex: 1;
width: calc(100% - 120rpx);
.shop-name {
display: flex;
align-items: center;
color: #333;
font-size: 28rpx;
line-height: 40rpx;
.icon {
display: block;
width: 40rpx;
height: 40rpx;
margin-right: 10rpx;
}
}
}
.order-id {
margin-top: 20rpx;
font-size: 24rpx;
color: #666;
}
.status {
width: 100rpx;
height: 40rpx;
border-radius: 10rpx;
color: #fff;
font-size: 24rpx;
line-height: 40rpx;
text-align: center;
background: rgba(197,39,51,1);
}
}
.product-info {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 0;
font-size: 28rpx;
.good-img {
.img {
display: block;
width: 120rpx;
height: 120rpx;
border-radius: 8rpx;
}
}
.name-wrap {
height: 120rpx;
width: calc(100% - 260rpx);
.name {
line-height: 40rpx;
}
.attr {
display: inline-block;
height: 50rpx;
max-width: 100%;
padding: 0 25rpx;
margin: 20rpx 0 0 0;
border-radius: 25rpx;
line-height: 50rpx;
color: #252525;
background: rgba(239,239,239,0.39);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.price-num {
width: 100rpx;
text-align: right;
line-height: 40rpx;
.num {
font-size: 20rpx;
}
}
}
.product-info2 {
.name-wrap {
display: flex;
flex-direction: column;
justify-content: space-between;
.attr {
padding: 0;
font-size: 24rpx;
color: #999;
background-color: #fff;
}
}
}
.order-bottom {
.time-total {
display: flex;
align-items: center;
justify-content: space-between;
color: #999;
font-size: 22rpx;
.total-txt {
color: #333;
font-size: 28rpx;
font-weight: 600;
}
.color-red {
color: #C52733;
}
}
.btns {
display: flex;
align-items: center;
justify-content: flex-end;
margin: 24rpx 0 0 0;
.btn {
height: 44rpx;
padding: 0 24rpx;
border-radius: 22rpx;
border: 1rpx solid #C52733;
color: #C52733;
font-size: 28rpx;
line-height: 44rpx;
text-align: center;
}
}
}
}
</style>