feat(client): 实现账号设备试用期管理功能
- 新增设备试用期过期时间字段及管理接口 - 实现试用期状态检查与过期提醒逻辑 - 支持账号类型区分试用与付费用户 - 添加设备注册时自动设置3天试用期- 实现VIP状态刷新与过期类型判断 -优化账号列表查询支持按客户端用户名过滤 - 更新客户端设备管理支持试用期控制- 完善登录流程支持试用期状态提示 -修复设备离线通知缺少用户名参数问题 - 调整账号默认设置清除逻辑关联客户端用户名
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { ref, computed, onMounted, defineAsyncComponent, inject } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { amazonApi } from '../../api/amazon'
|
||||
import { handlePlatformFileExport } from '../../utils/settings'
|
||||
|
||||
const TrialExpiredDialog = defineAsyncComponent(() => import('../common/TrialExpiredDialog.vue'))
|
||||
|
||||
const refreshVipStatus = inject<() => Promise<boolean>>('refreshVipStatus')
|
||||
|
||||
// 接收VIP状态
|
||||
const props = defineProps<{
|
||||
isVip: boolean
|
||||
@@ -24,6 +28,12 @@ const pageSize = ref(15)
|
||||
const amazonUpload = ref<HTMLInputElement | null>(null)
|
||||
const dragActive = ref(false)
|
||||
|
||||
// 试用期过期弹框
|
||||
const showTrialExpiredDialog = ref(false)
|
||||
const trialExpiredType = ref<'device' | 'account' | 'both'>('account')
|
||||
|
||||
const checkExpiredType = inject<() => 'device' | 'account' | 'both'>('checkExpiredType')
|
||||
|
||||
// 计算属性 - 当前页数据
|
||||
const paginatedData = computed(() => {
|
||||
const start = (currentPage.value - 1) * pageSize.value
|
||||
@@ -90,19 +100,13 @@ async function onDrop(e: DragEvent) {
|
||||
|
||||
// 批量获取产品信息 - 核心数据处理逻辑
|
||||
async function batchGetProductInfo(asinList: string[]) {
|
||||
// 刷新VIP状态
|
||||
if (refreshVipStatus) await refreshVipStatus()
|
||||
|
||||
// VIP检查
|
||||
if (!props.isVip) {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
'VIP已过期,数据采集功能受限。请联系管理员续费后继续使用。',
|
||||
'VIP功能限制',
|
||||
{
|
||||
confirmButtonText: '我知道了',
|
||||
showCancelButton: false,
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
} catch {}
|
||||
if (checkExpiredType) trialExpiredType.value = checkExpiredType()
|
||||
showTrialExpiredDialog.value = true
|
||||
return
|
||||
}
|
||||
|
||||
@@ -390,6 +394,9 @@ onMounted(async () => {
|
||||
<el-button type="primary" class="btn-blue" @click="amazonExampleVisible = false">我知道了</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 试用期过期弹框 -->
|
||||
<TrialExpiredDialog v-model="showTrialExpiredDialog" :expired-type="trialExpiredType" />
|
||||
|
||||
<!-- 表格上方进度条 -->
|
||||
<div v-if="progressVisible" class="progress-head">
|
||||
|
||||
Reference in New Issue
Block a user