| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <template>
- <view class="order-item" @click="handleClick">
- <!-- 订单头部 -->
- <view class="order-header">
- <view class="order-info">
- <text class="order-number">{{ t("订单号") }}:{{ item.orderNo }}</text>
- <text class="order-time">{{ useGlobal().$format(item.indate) }}</text>
- </view>
- <view class="order-status">
- {{ item.status_txt }}
- </view>
- </view>
- <!-- 商品信息 -->
- <view class="product-section">
- <view class="product-list">
- <view
- v-for="(product, index) in item.goods"
- :key="index"
- class="product-item"
- >
- <view class="product-image">
- <image :src="product.pic_url" mode="aspectFill" />
- </view>
- <view class="product-info">
- <view class="product-name">{{ product.shopName }}</view>
- <view class="product-spec" v-if="product.sku_desc">{{
- product.sku_desc
- }}</view>
- <view class="product-price">
- <text class="price">{{ formatCurrency(product.price) }}</text>
- <text class="quantity">x{{ product.total }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 订单金额 -->
- <view class="order-amount">
- <view class="shipping-fee" v-if="item.status == 300 && item.money">
- <text class="fee-label">{{ t("运费") }}:</text>
- <text class="fee-amount">{{ formatCurrency(item.money) }}</text>
- </view>
- </view>
- <!-- 操作按钮 -->
- <view class="order-actions" v-if="item.status == 300">
- <view class="action-btn" @click.stop="handleAction()">
- <trans _t="付款" />
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { useGlobal, formatCurrency } from "@/utils";
- import { t } from "@/locale";
- const props = defineProps({
- item: {
- type: Object,
- required: true,
- },
- });
- const emit = defineEmits(["click", "action"]);
- const handleClick = () => {
- emit("click", props.item);
- };
- const handleAction = () => {
- emit("action", props.item);
- };
- </script>
- <style lang="less" scoped>
- @import url("@/style.less");
- .order-item {
- background: var(--light);
- border-radius: 16rpx;
- padding: 30rpx;
- margin-bottom: 20rpx;
- box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05);
- .order-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24rpx;
- padding-bottom: 20rpx;
- border-bottom: 1rpx solid var(--border);
- .order-info {
- display: flex;
- flex-direction: column;
- gap: 8rpx;
- .order-number {
- font-size: 28rpx;
- font-weight: bold;
- color: var(--black);
- }
- .order-time {
- font-size: 24rpx;
- color: var(--text-01);
- }
- }
- .order-status {
- font-size: 24rpx;
- font-weight: bold;
- padding: 8rpx 16rpx;
- border-radius: 20rpx;
- color: var(--success);
- background: rgba(76, 175, 80, 0.1);
- }
- }
- .product-section {
- margin-bottom: 24rpx;
- .product-list {
- display: flex;
- flex-direction: column;
- gap: 20rpx;
- .product-item {
- display: flex;
- gap: 20rpx;
- .product-image {
- width: 120rpx;
- height: 120rpx;
- border-radius: 12rpx;
- overflow: hidden;
- background: var(--bg);
- image {
- width: 100%;
- height: 100%;
- }
- }
- .product-info {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .product-name {
- font-size: 28rpx;
- color: var(--black);
- line-height: 1.4;
- margin-bottom: 8rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .product-spec {
- font-size: 24rpx;
- color: var(--text-01);
- margin-bottom: 8rpx;
- }
- .product-price {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .price {
- font-size: 28rpx;
- font-weight: bold;
- color: var(--primary);
- }
- .quantity {
- font-size: 24rpx;
- color: var(--text-01);
- }
- }
- }
- }
- }
- }
- .order-amount {
- margin-bottom: 24rpx;
- padding-top: 20rpx;
- border-top: 1rpx solid var(--border);
- .amount-info {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .total-label {
- font-size: 24rpx;
- color: var(--text-01);
- }
- .total-amount {
- font-size: 32rpx;
- font-weight: bold;
- color: var(--black);
- }
- }
- .shipping-fee {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 8rpx 0;
- background: rgba(255, 193, 7, 0.1);
- border-radius: 8rpx;
- padding: 12rpx 16rpx;
- .fee-label {
- font-size: 24rpx;
- color: var(--warning);
- }
- .fee-amount {
- font-size: 26rpx;
- font-weight: bold;
- color: var(--warning);
- }
- }
- }
- .order-actions {
- display: flex;
- justify-content: flex-end;
- gap: 20rpx;
- padding-top: 20rpx;
- border-top: 1rpx solid var(--border);
- .action-btn {
- padding: 12rpx 24rpx;
- border-radius: 40rpx;
- font-size: 24rpx;
- font-weight: bold;
- text-align: center;
- min-width: 120rpx;
- background: var(--primary);
- color: var(--light);
- }
- }
- }
- </style>
|