fix: 修复BepUsdt签名错误和待支付订单付款入口
- payment.go: 添加timestamp字段到签名和请求体(参照官方epusdt实现) - payment.go: 修复amount格式化,使用strconv.FormatFloat替代Sprintf - payment.go: 修复expiration_time处理(毫秒转秒,计算剩余秒数) - payment.go: 修复apiURL尾部斜杠处理 - OrderDetail.vue: 添加去支付按钮(pending_payment状态) - Orders.vue: 添加去支付按钮(bepusdt跳转收银台)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<div class="status-section">
|
||||
<el-tag :type="statusType(order.status)" size="large">{{ statusText(order.status) }}</el-tag>
|
||||
<span v-if="order.payment_method" class="payment-method">支付方式: {{ paymentMethodText(order.payment_method) }}</span>
|
||||
<el-button v-if="order.status === 'pending_payment'" type="primary" @click="goPay">去支付</el-button>
|
||||
</div>
|
||||
|
||||
<div class="section-title">订单信息</div>
|
||||
@@ -57,12 +58,13 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { orderApi } from '../../api'
|
||||
import BackNav from '../../components/BackNav.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const order = ref<any>(null)
|
||||
const showRefund = ref(false)
|
||||
const refundReason = ref('')
|
||||
@@ -108,6 +110,14 @@ onMounted(async () => {
|
||||
order.value = res.data
|
||||
})
|
||||
|
||||
function goPay() {
|
||||
if (order.value?.payment_method === 'bepusdt') {
|
||||
router.push(`/checkout/${order.value.id}`)
|
||||
} else {
|
||||
ElMessage.info('请联系客服完成支付')
|
||||
}
|
||||
}
|
||||
|
||||
async function applyRefund() {
|
||||
if (!refundReason.value.trim()) {
|
||||
ElMessage.warning('请填写退款原因')
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<el-table-column label="操作" width="200">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="$router.push(`/orders/${row.id}`)">查看</el-button>
|
||||
<el-button v-if="row.status === 'pending_payment'" link type="success" size="small" @click="goPay(row)">去支付</el-button>
|
||||
<el-button v-if="row.status === 'pending_payment' || row.status === 'pending_confirm'" link type="warning" size="small" @click="cancelOrder(row.id)">取消</el-button>
|
||||
<el-button v-if="row.status === 'shipped'" link type="success" size="small" @click="confirmReceipt(row.id)">确认收货</el-button>
|
||||
</template>
|
||||
@@ -29,10 +30,12 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { orderApi } from '../../api'
|
||||
import BackNav from '../../components/BackNav.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const orders = ref<any[]>([])
|
||||
|
||||
const statusMap: Record<string, string> = {
|
||||
@@ -66,6 +69,14 @@ async function fetchOrders() {
|
||||
}
|
||||
}
|
||||
|
||||
function goPay(row: any) {
|
||||
if (row.payment_method === 'bepusdt') {
|
||||
router.push(`/checkout/${row.id}`)
|
||||
} else {
|
||||
ElMessage.info('请联系客服完成支付')
|
||||
}
|
||||
}
|
||||
|
||||
async function cancelOrder(id: number) {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要取消该订单吗?', '提示', { type: 'warning' })
|
||||
|
||||
Reference in New Issue
Block a user