Merge remote-tracking branch 'origin/ai-hub' into ai-hub

This commit is contained in:
ccnetcore
2025-10-15 19:51:28 +08:00
5 changed files with 293 additions and 502 deletions

View File

@@ -112,6 +112,13 @@ public class PayService : ApplicationService, IPayService
_logger.LogInformation("订单状态更新成功,订单号:{OutTradeNo},状态:{TradeStatus}", outTradeNo, tradeStatus); _logger.LogInformation("订单状态更新成功,订单号:{OutTradeNo},状态:{TradeStatus}", outTradeNo, tradeStatus);
// 验证交易状态,只有交易成功才执行充值逻辑
if (status != TradeStatusEnum.TRADE_SUCCESS)
{
_logger.LogError($"订单 {outTradeNo} 状态为 {tradeStatus},不执行充值逻辑");
return "success";
}
// 5. 根据商品类型进行不同的处理 // 5. 根据商品类型进行不同的处理
if (order.GoodsType.IsPremiumPackage()) if (order.GoodsType.IsPremiumPackage())
{ {

View File

@@ -141,14 +141,14 @@ function getWrapperClass(item: GetSessionListVO) {
> >
<template #trigger> <template #trigger>
<div <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" /> <SvgIcon name="models" size="12" />
<span class="text-sm font-medium">{{ currentModelName }}</span> <span class="text-sm font-medium">{{ currentModelName }}</span>
</div> </div>
</template> </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 <div
v-for="item in popoverList" v-for="item in popoverList"
:key="item.id" :key="item.id"
@@ -172,6 +172,13 @@ function getWrapperClass(item: GetSessionListVO) {
</template> </template>
<style scoped> <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 { @keyframes gradientFlow {
0%, 100% { background-position: 0 50%; } 0%, 100% { background-position: 0 50%; }

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Clock, Coin, TrophyBase, WarningFilled } from '@element-plus/icons-vue'; import { Clock, Coin, TrophyBase, WarningFilled } from '@element-plus/icons-vue';
import { getPremiumTokenPackage } from '@/api/user'; import { getPremiumTokenPackage } from '@/api/user';
import { showProductPackage } from '@/utils/product-package.ts';
// 尊享服务数据 // 尊享服务数据
const loading = ref(false); const loading = ref(false);
@@ -70,7 +71,6 @@ async function fetchPremiumTokenPackage() {
loading.value = true; loading.value = true;
try { try {
const res = await getPremiumTokenPackage(); const res = await getPremiumTokenPackage();
console.log('尊享服务Token包数据:', res);
if (res.data) { if (res.data) {
// 适配新的接口字段名 // 适配新的接口字段名
const data = res.data; const data = res.data;
@@ -109,6 +109,10 @@ function refreshData() {
onMounted(() => { onMounted(() => {
fetchPremiumTokenPackage(); fetchPremiumTokenPackage();
}); });
function onProductPackage() {
showProductPackage();
}
</script> </script>
<template> <template>
@@ -205,7 +209,7 @@ onMounted(() => {
<div class="progress-legend"> <div class="progress-legend">
<div class="legend-item"> <div class="legend-item">
<span class="legend-dot used-dot" /> <span class="legend-dot " :style="{ background: progressColor }" />
<span class="legend-text">已使用: {{ usagePercent }}%</span> <span class="legend-text">已使用: {{ usagePercent }}%</span>
</div> </div>
<div class="legend-item"> <div class="legend-item">
@@ -215,6 +219,25 @@ onMounted(() => {
</div> </div>
</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"> <div v-if="packageData.expireDate" class="expire-info">
<el-icon><Clock /></el-icon> <el-icon><Clock /></el-icon>
@@ -241,26 +264,6 @@ onMounted(() => {
</el-alert> </el-alert>
</div> </div>
</el-card> </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> </div>
</template> </template>

View File

@@ -374,7 +374,7 @@ onMounted(() => {
} }
.recharge-log-container { .recharge-log-container {
padding: 30px; padding: 10px;
background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%); background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
border-radius: 16px; border-radius: 16px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);