|
@@ -1,9 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<el-container class="order-detail">
|
|
<el-container class="order-detail">
|
|
- <el-main v-loading="loading" element-loading-text="加载中...">
|
|
|
|
|
|
+ <el-main v-loading="loading" :element-loading-text="t('common.loading')">
|
|
<!-- 订单轨迹 -->
|
|
<!-- 订单轨迹 -->
|
|
<div class="order-track sa-m-b-46">
|
|
<div class="order-track sa-m-b-46">
|
|
- <h3 class="sa-m-b-20">订单轨迹</h3>
|
|
|
|
|
|
+ <h3 class="sa-m-b-20">{{ t('modules.order.orderTrack') }}</h3>
|
|
<el-steps :active="getActiveStep()" align-center>
|
|
<el-steps :active="getActiveStep()" align-center>
|
|
<el-step v-for="(step, index) in orderSteps" :key="index" :title="step.title" :description="step.description"
|
|
<el-step v-for="(step, index) in orderSteps" :key="index" :title="step.title" :description="step.description"
|
|
:status="step.status" />
|
|
:status="step.status" />
|
|
@@ -12,18 +12,18 @@
|
|
|
|
|
|
<!-- 基本信息 -->
|
|
<!-- 基本信息 -->
|
|
<div class="basic-info sa-m-b-26">
|
|
<div class="basic-info sa-m-b-26">
|
|
- <h3 class="sa-m-b-20">基本信息</h3>
|
|
|
|
|
|
+ <h3 class="sa-m-b-20">{{ t('modules.order.basicInfo') }}</h3>
|
|
<!-- 第一行:订单编号、订单状态、拼团状态、全部金额 -->
|
|
<!-- 第一行:订单编号、订单状态、拼团状态、全部金额 -->
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">订单编号:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.orderNumber') }}:</span>
|
|
<span class="value">{{ state.orderDetail.orderId || '--' }}</span>
|
|
<span class="value">{{ state.orderDetail.orderId || '--' }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">订单状态:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.orderStatus') }}:</span>
|
|
<el-tag :type="getStatusType('order', state.orderDetail.status)">
|
|
<el-tag :type="getStatusType('order', state.orderDetail.status)">
|
|
{{ getStatusText('order', state.orderDetail.status) }}
|
|
{{ getStatusText('order', state.orderDetail.status) }}
|
|
</el-tag>
|
|
</el-tag>
|
|
@@ -31,7 +31,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">拼团状态:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.groupStatus') }}:</span>
|
|
<el-tag :type="getStatusType('pink', state.orderDetail.pinkStatus)">
|
|
<el-tag :type="getStatusType('pink', state.orderDetail.pinkStatus)">
|
|
{{ getStatusText('pink', state.orderDetail.pinkStatus) }}
|
|
{{ getStatusText('pink', state.orderDetail.pinkStatus) }}
|
|
</el-tag>
|
|
</el-tag>
|
|
@@ -39,7 +39,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">全部金额:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.totalAmount') }}:</span>
|
|
<span class="value">৳{{ state.orderDetail.totalPrice || 0 }}</span>
|
|
<span class="value">৳{{ state.orderDetail.totalPrice || 0 }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -48,7 +48,7 @@
|
|
<el-row :gutter="20" class="sa-m-t-12">
|
|
<el-row :gutter="20" class="sa-m-t-12">
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">中奖状态:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.winStatusLabel') }}:</span>
|
|
<el-tag :type="getStatusType('win', state.orderDetail.winStatus)">
|
|
<el-tag :type="getStatusType('win', state.orderDetail.winStatus)">
|
|
{{ getStatusText('win', state.orderDetail.winStatus) }}
|
|
{{ getStatusText('win', state.orderDetail.winStatus) }}
|
|
</el-tag>
|
|
</el-tag>
|
|
@@ -56,19 +56,19 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">用户名:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.username') }}:</span>
|
|
<span class="value">{{ state.realName || '--' }}</span>
|
|
<span class="value">{{ state.realName || '--' }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">支付方式:</span>
|
|
|
|
- <span class="value">{{ getPayTypeText(state.orderDetail.payType) }}</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.paymentMethod') }}:</span>
|
|
|
|
+ <span class="value">{{ getPayTypeTextI18n(state.orderDetail.payType) }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">优惠金额:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.discountAmount') }}:</span>
|
|
<span class="value">৳{{ state.orderDetail.deductionPrice || 0 }}</span>
|
|
<span class="value">৳{{ state.orderDetail.deductionPrice || 0 }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -77,25 +77,25 @@
|
|
<el-row :gutter="20" class="sa-m-t-12">
|
|
<el-row :gutter="20" class="sa-m-t-12">
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">奖励佣金:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.rewardCommission') }}:</span>
|
|
<span class="value">৳{{ state.orderDetail.brokerage || 0 }}</span>
|
|
<span class="value">৳{{ state.orderDetail.brokerage || 0 }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">手机号码:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.phoneNumber') }}:</span>
|
|
<span class="value">{{ state.orderDetail.userPhone || '--' }}</span>
|
|
<span class="value">{{ state.orderDetail.userPhone || '--' }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">支付金额:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.paymentAmount') }}:</span>
|
|
<span class="value">৳{{ state.orderDetail.totalPrice || 0 }}</span>
|
|
<span class="value">৳{{ state.orderDetail.totalPrice || 0 }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<div class="info-item">
|
|
<div class="info-item">
|
|
- <span class="label">实付金额:</span>
|
|
|
|
|
|
+ <span class="label">{{ t('modules.order.actualPayment') }}:</span>
|
|
<span class="value">৳{{ state.orderDetail.payPrice || 0 }}</span>
|
|
<span class="value">৳{{ state.orderDetail.payPrice || 0 }}</span>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -136,29 +136,32 @@
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
<div class="action-buttons sa-m-b-26">
|
|
<div class="action-buttons sa-m-b-26">
|
|
<!-- 取消订单按钮 - 只在待支付状态显示 -->
|
|
<!-- 取消订单按钮 - 只在待支付状态显示 -->
|
|
- <el-button v-if="state.orderDetail.status === 1" type="warning" plain @click="onCancelOrder">取消订单</el-button>
|
|
|
|
|
|
+ <el-button v-if="state.orderDetail.status === 1" type="warning" plain @click="onCancelOrder">{{
|
|
|
|
+ t('modules.order.cancelOrder') }}</el-button>
|
|
<!-- 立即发货按钮 - 待发货状态显示 -->
|
|
<!-- 立即发货按钮 - 待发货状态显示 -->
|
|
- <el-button type="primary" @click="onDispatch">立即发货测试</el-button>
|
|
|
|
- <el-button type="primary" @click="onDispatch" v-if="state.orderDetail.status === 5">立即发货</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="onDispatch">{{ t('modules.order.shipTest') }}</el-button>
|
|
|
|
+ <el-button type="primary" @click="onDispatch" v-if="state.orderDetail.status === 5">{{
|
|
|
|
+ t('modules.order.shipOrder')
|
|
|
|
+ }}</el-button>
|
|
<!-- 全部退款按钮 - 订单状态已支付且拼团状态未成团时显示 -->
|
|
<!-- 全部退款按钮 - 订单状态已支付且拼团状态未成团时显示 -->
|
|
<el-button v-if="state.orderDetail.status === 3 && state.orderDetail.pinkStatus === 1" type="danger" plain
|
|
<el-button v-if="state.orderDetail.status === 3 && state.orderDetail.pinkStatus === 1" type="danger" plain
|
|
@click="onRefund">
|
|
@click="onRefund">
|
|
- 退款
|
|
|
|
|
|
+ {{ t('modules.order.refund') }}
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
<!-- 商品信息 -->
|
|
<!-- 商品信息 -->
|
|
<div class="goods-content sa-m-b-16">
|
|
<div class="goods-content sa-m-b-16">
|
|
- <div class="sa-title sa-m-b-10">商品信息</div>
|
|
|
|
|
|
+ <div class="sa-title sa-m-b-10">{{ t('modules.order.goodsInfo') }}</div>
|
|
<el-table class="sa-table" :data="state.orderDetail.orderInfoVO" stripe border>
|
|
<el-table class="sa-table" :data="state.orderDetail.orderInfoVO" stripe border>
|
|
- <el-table-column label="商品图片" width="100" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.goodsImage')" width="100" align="center">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<el-image :src="row.image" style="width: 60px; height: 60px; border-radius: 4px" fit="cover" />
|
|
<el-image :src="row.image" style="width: 60px; height: 60px; border-radius: 4px" fit="cover" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="商品名称" prop="productName" />
|
|
|
|
- <el-table-column label="规格" prop="sku" align="center" />
|
|
|
|
- <el-table-column label="数量" prop="payNum" align="center" />
|
|
|
|
- <el-table-column label="单价" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.goodsName')" prop="productName" />
|
|
|
|
+ <el-table-column :label="t('modules.order.specification')" prop="sku" align="center" />
|
|
|
|
+ <el-table-column :label="t('modules.order.quantity')" prop="payNum" align="center" />
|
|
|
|
+ <el-table-column :label="t('modules.order.unitPrice')" align="center">
|
|
<template #default="{ row }"> ৳{{ row.price || '0' }} </template>
|
|
<template #default="{ row }"> ৳{{ row.price || '0' }} </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -166,21 +169,21 @@
|
|
|
|
|
|
<!-- 收货信息 - 在待收货和订单完成状态显示 -->
|
|
<!-- 收货信息 - 在待收货和订单完成状态显示 -->
|
|
<div class="address-content sa-m-b-16" v-if="[7, 8].includes(state.orderDetail.status)">
|
|
<div class="address-content sa-m-b-16" v-if="[7, 8].includes(state.orderDetail.status)">
|
|
- <div class="sa-title sa-m-b-10">收货信息</div>
|
|
|
|
|
|
+ <div class="sa-title sa-m-b-10">{{ t('modules.order.deliveryInfo') }}</div>
|
|
<el-table class="sa-table" :data="[state.orderDetail.orderAddressVO]" stripe border>
|
|
<el-table class="sa-table" :data="[state.orderDetail.orderAddressVO]" stripe border>
|
|
- <el-table-column label="收件人" prop="realName" align="center" />
|
|
|
|
- <el-table-column label="手机号" prop="phone" align="center" />
|
|
|
|
- <el-table-column label="详细地址" min-width="200">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.recipient')" prop="realName" align="center" />
|
|
|
|
+ <el-table-column :label="t('modules.order.phoneNumber')" prop="phone" align="center" />
|
|
|
|
+ <el-table-column :label="t('modules.order.detailAddress')" min-width="200">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
{{ getFullAddress(row) }}
|
|
{{ getFullAddress(row) }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="物流公司" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.expressCompany')" align="center">
|
|
<template #default>
|
|
<template #default>
|
|
{{ state.orderDetail.deliveryName || '--' }}
|
|
{{ state.orderDetail.deliveryName || '--' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="物流单号" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.trackingNumber')" align="center">
|
|
<template #default>
|
|
<template #default>
|
|
{{ state.orderDetail.deliveryId || '--' }}
|
|
{{ state.orderDetail.deliveryId || '--' }}
|
|
</template>
|
|
</template>
|
|
@@ -190,38 +193,41 @@
|
|
|
|
|
|
<!-- 拼团信息 -->
|
|
<!-- 拼团信息 -->
|
|
<div class="group-content" v-if="state.pinkList && state.pinkList.length > 0">
|
|
<div class="group-content" v-if="state.pinkList && state.pinkList.length > 0">
|
|
- <div class="sa-title sa-m-b-10">拼团信息({{ state.pinkList[0]?.people || '未知' }}人团)</div>
|
|
|
|
|
|
+ <div class="sa-title sa-m-b-10">{{ t('modules.order.groupInfo', {
|
|
|
|
+ people: state.pinkList[0]?.people ||
|
|
|
|
+ t('common.unknown')
|
|
|
|
+ }) }}</div>
|
|
<el-table class="sa-table" :data="state.pinkList" stripe border>
|
|
<el-table class="sa-table" :data="state.pinkList" stripe border>
|
|
- <el-table-column label="用户名" min-width="120" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.username')" min-width="120" align="center">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<el-link type="primary" @click="openUserDetail(row.uid)">
|
|
<el-link type="primary" @click="openUserDetail(row.uid)">
|
|
{{ row.name || '--' }}
|
|
{{ row.name || '--' }}
|
|
</el-link>
|
|
</el-link>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="手机号" min-width="150" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.phoneNumber')" min-width="150" align="center">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
{{ row.userPhone || '--' }}
|
|
{{ row.userPhone || '--' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="参团订单号" min-width="180" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.groupOrderNumber')" min-width="180" align="center">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<el-link type="primary" @click="openOrderDetail(row.orderIdKey)">
|
|
<el-link type="primary" @click="openOrderDetail(row.orderIdKey)">
|
|
{{ row.orderId || '--' }}
|
|
{{ row.orderId || '--' }}
|
|
</el-link>
|
|
</el-link>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="参团时间" min-width="160" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.joinTime')" min-width="160" align="center">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
{{ row.createTime || '--' }}
|
|
{{ row.createTime || '--' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="支付时间" min-width="160" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.payTime')" min-width="160" align="center">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
{{ row.payTime || '--' }}
|
|
{{ row.payTime || '--' }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="奖励佣金" min-width="120" align="center">
|
|
|
|
|
|
+ <el-table-column :label="t('modules.order.rewardCommission')" min-width="120" align="center">
|
|
<template #default="{ row }"> ৳{{ row.commission || 0 }} </template>
|
|
<template #default="{ row }"> ৳{{ row.commission || 0 }} </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -231,13 +237,14 @@
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
import { onMounted, reactive, ref, computed } from 'vue';
|
|
import { onMounted, reactive, ref, computed } from 'vue';
|
|
|
|
+import { useI18n } from 'vue-i18n';
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
import {
|
|
import {
|
|
api,
|
|
api,
|
|
getOrderStatusInfo,
|
|
getOrderStatusInfo,
|
|
getPinkStatusInfo,
|
|
getPinkStatusInfo,
|
|
getWinStatusInfo,
|
|
getWinStatusInfo,
|
|
- getPayTypeText,
|
|
|
|
|
|
+ getOrderStatusConfig,
|
|
} from '../order.service';
|
|
} from '../order.service';
|
|
import { useModal } from '@/sheep/hooks';
|
|
import { useModal } from '@/sheep/hooks';
|
|
import OrderDispatch from './dispatch.vue';
|
|
import OrderDispatch from './dispatch.vue';
|
|
@@ -245,6 +252,8 @@ import OrderRefund from './refund.vue';
|
|
import UserDetail from '../../user/list/detail.vue';
|
|
import UserDetail from '../../user/list/detail.vue';
|
|
import OrderDetailC from './detail.vue';
|
|
import OrderDetailC from './detail.vue';
|
|
|
|
|
|
|
|
+const { t } = useI18n();
|
|
|
|
+
|
|
const emit = defineEmits(['modalCallBack']);
|
|
const emit = defineEmits(['modalCallBack']);
|
|
const props = defineProps(['modal']);
|
|
const props = defineProps(['modal']);
|
|
|
|
|
|
@@ -257,20 +266,20 @@ const state = reactive({
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
|
|
|
// 订单步骤配置
|
|
// 订单步骤配置
|
|
-const stepConfig = [
|
|
|
|
- { key: 'create_order', title: '提交订单', waitText: '未提交' },
|
|
|
|
- { key: 'payment', title: '付款', waitText: '未支付' },
|
|
|
|
- { key: 'group_start', title: '开团', waitText: '未开团' },
|
|
|
|
- { key: 'platform_ship', title: '平台发货', waitText: '未发货' },
|
|
|
|
- { key: 'user_receive', title: '用户收货', waitText: '未收货' },
|
|
|
|
-];
|
|
|
|
|
|
+const stepConfig = computed(() => [
|
|
|
|
+ { key: 'create_order', title: t('modules.order.steps.createOrder'), waitText: t('modules.order.steps.notSubmitted') },
|
|
|
|
+ { key: 'payment', title: t('modules.order.steps.payment'), waitText: t('modules.order.steps.notPaid') },
|
|
|
|
+ { key: 'group_start', title: t('modules.order.steps.groupStart'), waitText: t('modules.order.steps.notGrouped') },
|
|
|
|
+ { key: 'platform_ship', title: t('modules.order.steps.platformShip'), waitText: t('modules.order.steps.notShipped') },
|
|
|
|
+ { key: 'user_receive', title: t('modules.order.steps.userReceive'), waitText: t('modules.order.steps.notReceived') },
|
|
|
|
+]);
|
|
|
|
|
|
// 计算订单步骤
|
|
// 计算订单步骤
|
|
const orderSteps = computed(() => {
|
|
const orderSteps = computed(() => {
|
|
const trackData = state.orderDetail.orderStatusVO || [];
|
|
const trackData = state.orderDetail.orderStatusVO || [];
|
|
const steps = [];
|
|
const steps = [];
|
|
|
|
|
|
- stepConfig.forEach((config, index) => {
|
|
|
|
|
|
+ stepConfig.value.forEach((config, index) => {
|
|
const trackItem = trackData[index];
|
|
const trackItem = trackData[index];
|
|
|
|
|
|
if (trackItem) {
|
|
if (trackItem) {
|
|
@@ -311,7 +320,7 @@ async function getOrderDetail() {
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('获取订单详情失败:', error);
|
|
console.error('获取订单详情失败:', error);
|
|
- ElMessage.error('获取订单详情失败');
|
|
|
|
|
|
+ ElMessage.error(t('modules.order.getOrderDetailFailed'));
|
|
} finally {
|
|
} finally {
|
|
loading.value = false;
|
|
loading.value = false;
|
|
}
|
|
}
|
|
@@ -338,23 +347,31 @@ function getActiveStep() {
|
|
return Math.max(0, trackData.length - 1);
|
|
return Math.max(0, trackData.length - 1);
|
|
}
|
|
}
|
|
|
|
|
|
-// 通用状态处理函数
|
|
|
|
|
|
+// 通用状态处理函数 - 使用国际化配置
|
|
const getStatusText = (type, value) => {
|
|
const getStatusText = (type, value) => {
|
|
|
|
+ const config = getOrderStatusConfig(t);
|
|
const statusMap = {
|
|
const statusMap = {
|
|
- order: getOrderStatusInfo,
|
|
|
|
- pink: getPinkStatusInfo,
|
|
|
|
- win: getWinStatusInfo,
|
|
|
|
|
|
+ order: config.ORDER_STATUS,
|
|
|
|
+ pink: config.PINK_STATUS,
|
|
|
|
+ win: config.WIN_STATUS,
|
|
};
|
|
};
|
|
- return statusMap[type]?.(value)?.text || '未知';
|
|
|
|
|
|
+ return statusMap[type]?.[value]?.text || t('common.unknown');
|
|
};
|
|
};
|
|
|
|
|
|
const getStatusType = (type, value) => {
|
|
const getStatusType = (type, value) => {
|
|
|
|
+ const config = getOrderStatusConfig(t);
|
|
const statusMap = {
|
|
const statusMap = {
|
|
- order: getOrderStatusInfo,
|
|
|
|
- pink: getPinkStatusInfo,
|
|
|
|
- win: getWinStatusInfo,
|
|
|
|
|
|
+ order: config.ORDER_STATUS,
|
|
|
|
+ pink: config.PINK_STATUS,
|
|
|
|
+ win: config.WIN_STATUS,
|
|
};
|
|
};
|
|
- return statusMap[type]?.(value)?.type || 'info';
|
|
|
|
|
|
+ return statusMap[type]?.[value]?.type || 'info';
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+// 获取支付方式文本 - 使用国际化配置
|
|
|
|
+const getPayTypeTextI18n = (payType) => {
|
|
|
|
+ const config = getOrderStatusConfig(t);
|
|
|
|
+ return config.PAY_TYPE[payType] || payType || t('common.unknown');
|
|
};
|
|
};
|
|
|
|
|
|
// 拼接完整地址
|
|
// 拼接完整地址
|
|
@@ -381,7 +398,7 @@ function openUserDetail(uid) {
|
|
useModal(
|
|
useModal(
|
|
UserDetail,
|
|
UserDetail,
|
|
{
|
|
{
|
|
- title: '用户详情',
|
|
|
|
|
|
+ title: t('modules.user.userDetail'),
|
|
id: uid,
|
|
id: uid,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -395,18 +412,18 @@ function openUserDetail(uid) {
|
|
// 取消订单
|
|
// 取消订单
|
|
async function onCancelOrder() {
|
|
async function onCancelOrder() {
|
|
try {
|
|
try {
|
|
- await ElMessageBox.confirm('确定要取消这个订单吗?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
|
+ await ElMessageBox.confirm(t('modules.order.confirmCancelOrder'), t('common.tip'), {
|
|
|
|
+ confirmButtonText: t('common.confirm'),
|
|
|
|
+ cancelButtonText: t('common.cancel'),
|
|
type: 'warning',
|
|
type: 'warning',
|
|
});
|
|
});
|
|
|
|
|
|
const { code, message } = await api.order.cancel(String(state.orderDetail.id));
|
|
const { code, message } = await api.order.cancel(String(state.orderDetail.id));
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- ElMessage.success('订单取消成功');
|
|
|
|
|
|
+ ElMessage.success(t('modules.order.cancelOrderSuccess'));
|
|
getOrderDetail(); // 刷新订单详情
|
|
getOrderDetail(); // 刷新订单详情
|
|
} else {
|
|
} else {
|
|
- ElMessage.error(message || '取消订单失败');
|
|
|
|
|
|
+ ElMessage.error(message || t('modules.order.cancelOrderFailed'));
|
|
}
|
|
}
|
|
} catch (error) { }
|
|
} catch (error) { }
|
|
}
|
|
}
|
|
@@ -416,7 +433,7 @@ function onDispatch() {
|
|
useModal(
|
|
useModal(
|
|
OrderDispatch,
|
|
OrderDispatch,
|
|
{
|
|
{
|
|
- title: '订单发货',
|
|
|
|
|
|
+ title: t('modules.order.orderDispatch'),
|
|
data: state.orderDetail,
|
|
data: state.orderDetail,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -430,9 +447,9 @@ function onDispatch() {
|
|
// 全部退款
|
|
// 全部退款
|
|
async function onRefund() {
|
|
async function onRefund() {
|
|
try {
|
|
try {
|
|
- await ElMessageBox.confirm('确定要对这个订单进行全部退款吗?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
|
+ await ElMessageBox.confirm(t('modules.order.confirmFullRefund'), t('common.tip'), {
|
|
|
|
+ confirmButtonText: t('common.confirm'),
|
|
|
|
+ cancelButtonText: t('common.cancel'),
|
|
type: 'warning',
|
|
type: 'warning',
|
|
});
|
|
});
|
|
|
|
|
|
@@ -472,7 +489,7 @@ async function openOrderDetailByOrderId(orderId) {
|
|
useModal(
|
|
useModal(
|
|
OrderDetailC,
|
|
OrderDetailC,
|
|
{
|
|
{
|
|
- title: '订单详情',
|
|
|
|
|
|
+ title: t('modules.order.orderDetail'),
|
|
type: 'detail',
|
|
type: 'detail',
|
|
id: orderId, // 这里可能需要转换为数据库ID
|
|
id: orderId, // 这里可能需要转换为数据库ID
|
|
},
|
|
},
|
|
@@ -484,7 +501,7 @@ async function openOrderDetailByOrderId(orderId) {
|
|
);
|
|
);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('打开订单详情失败:', error);
|
|
console.error('打开订单详情失败:', error);
|
|
- ElMessage.error('打开订单详情失败');
|
|
|
|
|
|
+ ElMessage.error(t('modules.order.openOrderDetailFailed'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -492,14 +509,14 @@ async function openOrderDetailByOrderId(orderId) {
|
|
function onOpenDispatch() {
|
|
function onOpenDispatch() {
|
|
// 检查订单数据是否完整
|
|
// 检查订单数据是否完整
|
|
if (!state.orderDetail || !state.orderDetail.orderInfoVO) {
|
|
if (!state.orderDetail || !state.orderDetail.orderInfoVO) {
|
|
- ElMessage.error('订单数据加载中,请稍后再试');
|
|
|
|
|
|
+ ElMessage.error(t('modules.order.orderDataLoading'));
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
useModal(
|
|
useModal(
|
|
OrderDispatch,
|
|
OrderDispatch,
|
|
{
|
|
{
|
|
- title: '订单发货',
|
|
|
|
|
|
+ title: t('modules.order.orderDispatch'),
|
|
data: state.orderDetail,
|
|
data: state.orderDetail,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -515,7 +532,7 @@ function onOpenRefund() {
|
|
useModal(
|
|
useModal(
|
|
OrderRefund,
|
|
OrderRefund,
|
|
{
|
|
{
|
|
- title: '订单退款',
|
|
|
|
|
|
+ title: t('modules.order.orderRefund'),
|
|
width: '600px',
|
|
width: '600px',
|
|
params: {
|
|
params: {
|
|
id: state.orderDetail.id,
|
|
id: state.orderDetail.id,
|
|
@@ -534,10 +551,10 @@ async function onContactUser() {
|
|
try {
|
|
try {
|
|
const { code } = await api.order.contact(state.orderDetail.id);
|
|
const { code } = await api.order.contact(state.orderDetail.id);
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- ElMessage.success('已发送联系信息');
|
|
|
|
|
|
+ ElMessage.success(t('modules.order.contactSent'));
|
|
}
|
|
}
|
|
} catch (err) {
|
|
} catch (err) {
|
|
- ElMessage.error('联系用户失败');
|
|
|
|
|
|
+ ElMessage.error(t('modules.order.contactUserFailed'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -546,13 +563,13 @@ async function onExportOrder() {
|
|
try {
|
|
try {
|
|
const { code, data } = await api.order.export(state.orderDetail.id);
|
|
const { code, data } = await api.order.export(state.orderDetail.id);
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- ElMessage.success('导出成功');
|
|
|
|
|
|
+ ElMessage.success(t('modules.order.exportSuccess'));
|
|
if (data.download_url) {
|
|
if (data.download_url) {
|
|
window.open(data.download_url);
|
|
window.open(data.download_url);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (err) {
|
|
} catch (err) {
|
|
- ElMessage.error('导出订单失败');
|
|
|
|
|
|
+ ElMessage.error(t('modules.order.exportOrderFailed'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -561,11 +578,11 @@ async function onCloseOrder() {
|
|
try {
|
|
try {
|
|
const { code } = await api.order.close(state.orderDetail.id);
|
|
const { code } = await api.order.close(state.orderDetail.id);
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- ElMessage.success('订单已关闭');
|
|
|
|
|
|
+ ElMessage.success(t('modules.order.orderClosed'));
|
|
getOrderDetail();
|
|
getOrderDetail();
|
|
}
|
|
}
|
|
} catch (err) {
|
|
} catch (err) {
|
|
- ElMessage.error('关闭订单失败');
|
|
|
|
|
|
+ ElMessage.error(t('modules.order.closeOrderFailed'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -580,12 +597,12 @@ async function onConfirmMemo() {
|
|
try {
|
|
try {
|
|
const { code } = await api.order.editMemo(state.orderDetail.id, { memo: memoForm.data });
|
|
const { code } = await api.order.editMemo(state.orderDetail.id, { memo: memoForm.data });
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- ElMessage.success('备注更新成功');
|
|
|
|
|
|
+ ElMessage.success(t('modules.order.memoUpdateSuccess'));
|
|
memoForm.flag = false;
|
|
memoForm.flag = false;
|
|
getOrderDetail();
|
|
getOrderDetail();
|
|
}
|
|
}
|
|
} catch (err) {
|
|
} catch (err) {
|
|
- ElMessage.error('备注更新失败');
|
|
|
|
|
|
+ ElMessage.error(t('modules.order.memoUpdateFailed'));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|