|
|
@@ -1,10 +1,19 @@
|
|
|
<template>
|
|
|
- <div class="flex items-center justify-center flex-wrap space-x-4">
|
|
|
- <ElCard v-for="item in plans" :key="item.id" class="mb-4 !rounded-lg" :body-style="{ padding: 0 }">
|
|
|
- <div class="w-40 h-60 flex flex-col items-center justify-center">
|
|
|
- <div class="text-xl text-gray-500">{{ item.name }}</div>
|
|
|
- <div class="text-2xl mt-8">¥{{ item.price }}</div>
|
|
|
+ <div class="flex items-center justify-center flex-wrap">
|
|
|
+ <ElCard
|
|
|
+ v-for="item in plans"
|
|
|
+ :key="item.id"
|
|
|
+ class="w-56 h-72 lg:w-64 lg:h-96 mx-8 mb-8 !rounded-lg"
|
|
|
+ :body-style="{ padding: 0, height: '100%' }"
|
|
|
+ >
|
|
|
+ <div class="h-full flex flex-col items-center justify-center">
|
|
|
+ <div class="text-base lg:text-xl text-gray-500">{{ item.name }}</div>
|
|
|
+ <div class="text-xl lg:text-3xl mt-8 font-bold">¥{{ item.price }}</div>
|
|
|
<div class="text-sm mt-8 text-gray-500">有效期:{{ item.duration }}天</div>
|
|
|
+ <div class="mt-8">
|
|
|
+ <ElTag :type="item.enabled ? 'success' : 'info'">{{ item.enabled ? '启用' : '禁用' }}</ElTag>
|
|
|
+ <ElTag class="ml-4" v-if="item.commissionable">分佣</ElTag>
|
|
|
+ </div>
|
|
|
<div class="mt-8">
|
|
|
<ElButton type="primary" link @click="editPlan(item)">编辑</ElButton>
|
|
|
<ElButton type="danger" link @click="deletePlan(item)">删除</ElButton>
|
|
|
@@ -29,6 +38,12 @@
|
|
|
<ElFormItem prop="tokenLimit" label="Token限制">
|
|
|
<ElInput v-model="model.tokenLimit" />
|
|
|
</ElFormItem>
|
|
|
+ <ElFormItem prop="commissionable" label="分佣">
|
|
|
+ <ElSwitch v-model="model.commissionable" />
|
|
|
+ </ElFormItem>
|
|
|
+ <ElFormItem prop="enabled" label="开启">
|
|
|
+ <ElSwitch v-model="model.enabled" />
|
|
|
+ </ElFormItem>
|
|
|
</ElForm>
|
|
|
<template #footer>
|
|
|
<ElButton :disabled="loading" @click="showEditDialog = false">取消</ElButton>
|
|
|
@@ -69,7 +84,9 @@ async function editPlan(plan) {
|
|
|
name: '',
|
|
|
price: '',
|
|
|
duration: '',
|
|
|
- tokenLimit: ''
|
|
|
+ tokenLimit: '',
|
|
|
+ commissionable: false,
|
|
|
+ enabled: false
|
|
|
}
|
|
|
}
|
|
|
showEditDialog.value = true
|