Merge remote-tracking branch 'origin/ai-hub' into ai-hub
This commit is contained in:
@@ -112,6 +112,13 @@ public class PayService : ApplicationService, IPayService
|
||||
|
||||
_logger.LogInformation("订单状态更新成功,订单号:{OutTradeNo},状态:{TradeStatus}", outTradeNo, tradeStatus);
|
||||
|
||||
// 验证交易状态,只有交易成功才执行充值逻辑
|
||||
if (status != TradeStatusEnum.TRADE_SUCCESS)
|
||||
{
|
||||
_logger.LogError($"订单 {outTradeNo} 状态为 {tradeStatus},不执行充值逻辑");
|
||||
return "success";
|
||||
}
|
||||
|
||||
// 5. 根据商品类型进行不同的处理
|
||||
if (order.GoodsType.IsPremiumPackage())
|
||||
{
|
||||
|
||||
@@ -141,14 +141,14 @@ function getWrapperClass(item: GetSessionListVO) {
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
class="flex items-center gap-1 p-2 rounded-md border border-blue-500 text-blue-600 cursor-pointer select-none"
|
||||
class="flex items-center gap-1 p-2 rounded-md border border-blue-500 text-blue-600 cursor-pointer select-none model-select-box "
|
||||
>
|
||||
<SvgIcon name="models" size="12" />
|
||||
<span class="text-sm font-medium">{{ currentModelName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="flex flex-col gap-1 max-h-52 overflow-y-auto p-1">
|
||||
<div class="flex flex-col gap-1 max-h-100 overflow-y-auto p-1">
|
||||
<div
|
||||
v-for="item in popoverList"
|
||||
:key="item.id"
|
||||
@@ -172,6 +172,13 @@ function getWrapperClass(item: GetSessionListVO) {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.model-select-box {
|
||||
color: var(--el-color-primary, #409eff);
|
||||
background: var(--el-color-primary-light-9, rgb(235.9 245.3 255));
|
||||
border: 1px solid var(--el-color-primary, #409eff);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* 彩色流光动画 */
|
||||
@keyframes gradientFlow {
|
||||
0%, 100% { background-position: 0 50%; }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { Clock, Coin, TrophyBase, WarningFilled } from '@element-plus/icons-vue';
|
||||
import { getPremiumTokenPackage } from '@/api/user';
|
||||
import { showProductPackage } from '@/utils/product-package.ts';
|
||||
|
||||
// 尊享服务数据
|
||||
const loading = ref(false);
|
||||
@@ -70,7 +71,6 @@ async function fetchPremiumTokenPackage() {
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getPremiumTokenPackage();
|
||||
console.log('尊享服务Token包数据:', res);
|
||||
if (res.data) {
|
||||
// 适配新的接口字段名
|
||||
const data = res.data;
|
||||
@@ -109,6 +109,10 @@ function refreshData() {
|
||||
onMounted(() => {
|
||||
fetchPremiumTokenPackage();
|
||||
});
|
||||
|
||||
function onProductPackage() {
|
||||
showProductPackage();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -205,7 +209,7 @@ onMounted(() => {
|
||||
|
||||
<div class="progress-legend">
|
||||
<div class="legend-item">
|
||||
<span class="legend-dot used-dot" />
|
||||
<span class="legend-dot " :style="{ background: progressColor }" />
|
||||
<span class="legend-text">已使用: {{ usagePercent }}%</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
@@ -215,6 +219,25 @@ onMounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 购买提示卡片(额度不足时显示) -->
|
||||
<el-card
|
||||
v-if="remainingPercent < 20"
|
||||
class="warning-card"
|
||||
shadow="hover"
|
||||
>
|
||||
<div class="warning-content">
|
||||
<el-icon class="warning-icon" color="#e6a23c">
|
||||
<WarningFilled />
|
||||
</el-icon>
|
||||
<div class="warning-text">
|
||||
<h3>额度即将用完</h3>
|
||||
<p>您的Token额度已使用{{ usagePercent }}%,剩余额度较少,建议及时充值。</p>
|
||||
</div>
|
||||
<el-button type="warning" @click="onProductPackage()">
|
||||
立即充值
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 过期时间 -->
|
||||
<div v-if="packageData.expireDate" class="expire-info">
|
||||
<el-icon><Clock /></el-icon>
|
||||
@@ -241,26 +264,6 @@ onMounted(() => {
|
||||
</el-alert>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 购买提示卡片(额度不足时显示) -->
|
||||
<el-card
|
||||
v-if="remainingPercent < 20"
|
||||
class="warning-card"
|
||||
shadow="hover"
|
||||
>
|
||||
<div class="warning-content">
|
||||
<el-icon class="warning-icon" color="#e6a23c">
|
||||
<WarningFilled />
|
||||
</el-icon>
|
||||
<div class="warning-text">
|
||||
<h3>额度即将用完</h3>
|
||||
<p>您的Token额度已使用{{ usagePercent }}%,剩余额度较少,建议及时充值。</p>
|
||||
</div>
|
||||
<el-button type="warning" @click="$router.push('/products')">
|
||||
立即充值
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -374,7 +374,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.recharge-log-container {
|
||||
padding: 30px;
|
||||
padding: 10px;
|
||||
background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
|
||||
|
||||
Reference in New Issue
Block a user