feat: 新增广告唯一标识并优化相关功能
- 在广告模型中添加唯一标识字段 -优化广告编辑界面布局和提示文本 - 调整搜索按钮禁用逻辑,移除与 websiteId 相关的条件 - 修复优惠券列表中的数值格式化问题 - 优化经销商申请编辑界面布局 - 更新环境变量配置,注释掉 API URL
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
VITE_APP_NAME=后台管理(开发环境)
|
VITE_APP_NAME=后台管理(开发环境)
|
||||||
VITE_API_URL=http://127.0.0.1:9200/api
|
#VITE_API_URL=http://127.0.0.1:9200/api
|
||||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
mp-vue-0813.zip
BIN
mp-vue-0813.zip
Binary file not shown.
@@ -8,6 +8,8 @@ export interface CmsAd {
|
|||||||
adId?: number;
|
adId?: number;
|
||||||
// 类型
|
// 类型
|
||||||
type?: number;
|
type?: number;
|
||||||
|
// 唯一标识
|
||||||
|
code?: string;
|
||||||
// 栏目分类
|
// 栏目分类
|
||||||
categoryId?: number;
|
categoryId?: number;
|
||||||
// 栏目名称
|
// 栏目名称
|
||||||
|
|||||||
@@ -65,5 +65,7 @@ export interface ShopCoupon {
|
|||||||
*/
|
*/
|
||||||
export interface ShopCouponParam extends PageParam {
|
export interface ShopCouponParam extends PageParam {
|
||||||
id?: number;
|
id?: number;
|
||||||
|
name?: string;
|
||||||
|
type?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ export interface ShopGift {
|
|||||||
code?: string;
|
code?: string;
|
||||||
// 商品ID
|
// 商品ID
|
||||||
goodsId?: number;
|
goodsId?: number;
|
||||||
|
// 商品名称
|
||||||
|
goodsName?: string;
|
||||||
|
// 面值
|
||||||
|
faceValue?: string;
|
||||||
// 领取时间
|
// 领取时间
|
||||||
takeTime?: string;
|
takeTime?: string;
|
||||||
// 核销时间
|
// 核销时间
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ import {logout} from '@/utils/page-tab-util';
|
|||||||
import {listRoles} from '@/api/system/role';
|
import {listRoles} from '@/api/system/role';
|
||||||
import { useSiteStore } from '@/store/modules/site';
|
import { useSiteStore } from '@/store/modules/site';
|
||||||
import Qrcode from "@/components/QrCode/index.vue";
|
import Qrcode from "@/components/QrCode/index.vue";
|
||||||
|
import {AppInfo} from "@/api/cms/cmsWebsite/model";
|
||||||
|
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
@@ -183,7 +184,7 @@ const settingVisible = ref(false);
|
|||||||
|
|
||||||
// 当前用户信息
|
// 当前用户信息
|
||||||
const loginUser = computed(() => userStore.info ?? {});
|
const loginUser = computed(() => userStore.info ?? {});
|
||||||
const website = ref<CmsWebsite>();
|
const website = ref<AppInfo>();
|
||||||
|
|
||||||
/* 用户信息下拉点击 */
|
/* 用户信息下拉点击 */
|
||||||
const onUserDropClick = ({key}) => {
|
const onUserDropClick = ({key}) => {
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="标题" name="name">
|
<a-form-item label="名称" name="name">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
:maxlength="100"
|
:maxlength="100"
|
||||||
style="width: 500px"
|
style="width: 500px"
|
||||||
placeholder="请输入广告标题"
|
placeholder="请输入广告名称"
|
||||||
v-model:value="form.name"
|
v-model:value="form.name"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<a-space class="flex flex-col gap-2">
|
<a-space class="flex flex-col gap-2">
|
||||||
<div class="w-[500px]" v-for="(item, index) in images" :key="index">
|
<div class="w-[500px]" v-for="(_, index) in images" :key="index">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="images[index].path"
|
v-model:value="images[index].path"
|
||||||
placeholder="https://"
|
placeholder="https://"
|
||||||
@@ -129,13 +129,13 @@
|
|||||||
<span class="text-gray-400">广告位尺寸大小(默认值:100% * 500px)</span>
|
<span class="text-gray-400">广告位尺寸大小(默认值:100% * 500px)</span>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="栏目">
|
<a-form-item label="所属栏目">
|
||||||
<a-tree-select
|
<a-tree-select
|
||||||
allow-clear
|
allow-clear
|
||||||
:tree-data="navigationList"
|
:tree-data="navigationList"
|
||||||
tree-default-expand-all
|
tree-default-expand-all
|
||||||
style="width: 500px;"
|
style="width: 500px;"
|
||||||
placeholder="请选择栏目"
|
placeholder="请选择所属栏目"
|
||||||
:value="form.categoryId || undefined"
|
:value="form.categoryId || undefined"
|
||||||
:listHeight="700"
|
:listHeight="700"
|
||||||
:dropdown-style="{ overflow: 'auto' }"
|
:dropdown-style="{ overflow: 'auto' }"
|
||||||
@@ -143,6 +143,15 @@
|
|||||||
@change="onCategoryId"
|
@change="onCategoryId"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item label="唯一标识" name="code">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
:maxlength="100"
|
||||||
|
style="width: 500px"
|
||||||
|
placeholder="请输入广告唯一标识"
|
||||||
|
v-model:value="form.code"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label="样式" name="style">
|
<a-form-item label="样式" name="style">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
@@ -229,6 +238,7 @@ const formRef = ref<FormInstance | null>(null);
|
|||||||
const form = reactive<CmsAd>({
|
const form = reactive<CmsAd>({
|
||||||
adId: undefined,
|
adId: undefined,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
|
code: undefined,
|
||||||
categoryId: undefined,
|
categoryId: undefined,
|
||||||
name: '',
|
name: '',
|
||||||
style: '',
|
style: '',
|
||||||
@@ -273,7 +283,7 @@ const rules = reactive({
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
message: '请上传图片或视频',
|
message: '请上传图片或视频',
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
validator: (_rule: Rule, value: string) => {
|
validator: (_rule: Rule, _: string) => {
|
||||||
return new Promise<void>((resolve, reject) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
if (images.value.length == 0) {
|
if (images.value.length == 0) {
|
||||||
return reject('请上传图片或视频文件');
|
return reject('请上传图片或视频文件');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="add">
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ import type {CmsAd, CmsAdParam} from '@/api/cms/cmsAd/model';
|
|||||||
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
|
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
|
||||||
import {listCmsNavigation} from "@/api/cms/cmsNavigation";
|
import {listCmsNavigation} from "@/api/cms/cmsNavigation";
|
||||||
import {getPageTitle} from "@/utils/common";
|
import {getPageTitle} from "@/utils/common";
|
||||||
import Extra from "@/views/cms/cmsNavigation/components/extra.vue";
|
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="add">
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined/>
|
<PlusOutlined/>
|
||||||
</template>
|
</template>
|
||||||
@@ -68,8 +68,8 @@
|
|||||||
@search="reload"
|
@search="reload"
|
||||||
/>
|
/>
|
||||||
<a-button type="text" @click="reset">重置</a-button>
|
<a-button type="text" @click="reset">重置</a-button>
|
||||||
<a-button type="text" :disabled="!websiteId" @click="handleExport">导出xls</a-button>
|
<a-button type="text" @click="handleExport">导出xls</a-button>
|
||||||
<a-button type="text" :disabled="!websiteId" @click="openImport">导入xls</a-button>
|
<a-button type="text" @click="openImport">导入xls</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
|
||||||
<!-- 导入弹窗 -->
|
<!-- 导入弹窗 -->
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="add">
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap;">
|
<a-space :size="10" style="flex-wrap: wrap;">
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="add">
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -75,9 +75,8 @@
|
|||||||
<!-- />-->
|
<!-- />-->
|
||||||
<!-- </a-form-item>-->
|
<!-- </a-form-item>-->
|
||||||
<a-form-item
|
<a-form-item
|
||||||
:label="form.model == 'links' ? '链接地址' : '路由地址'"
|
:label="'path'"
|
||||||
name="path"
|
name="path"
|
||||||
v-if="form.model == 'links'"
|
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
@@ -252,7 +251,7 @@ const loading = ref(false);
|
|||||||
// 已上传数据
|
// 已上传数据
|
||||||
const images = ref<ItemType[]>([]);
|
const images = ref<ItemType[]>([]);
|
||||||
const password = ref();
|
const password = ref();
|
||||||
const pathPlaceholder = ref<string>('请输入链接地址');
|
const pathPlaceholder = ref<string>('/pages/index/index');
|
||||||
const lang = ref(localStorage.getItem('i18n-lang'));
|
const lang = ref(localStorage.getItem('i18n-lang'));
|
||||||
const zhCmsNavigationList = ref<CmsNavigation[]>([]);
|
const zhCmsNavigationList = ref<CmsNavigation[]>([]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="openEdit()">
|
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined/>
|
<plus-outlined/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
>
|
>
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="openEdit()">
|
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined/>
|
<plus-outlined/>
|
||||||
</template>
|
</template>
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
<a-space>
|
<a-space>
|
||||||
<a-avatar v-if="record.icon" :size="22" :src="record.icon"/>
|
<a-avatar v-if="record.icon" :size="22" :src="record.icon"/>
|
||||||
<a @click="push({
|
<a @click="push({
|
||||||
path: `/website/article`,
|
path: `/article`,
|
||||||
query: {
|
query: {
|
||||||
id: record.navigationId,
|
id: record.navigationId,
|
||||||
name: record.title,
|
name: record.title,
|
||||||
@@ -431,6 +431,7 @@ const parseData = (data: CmsNavigation[]) => {
|
|||||||
/* 表格渲染完成回调 */
|
/* 表格渲染完成回调 */
|
||||||
const onDone: EleProTableDone<CmsNavigation> = ({data}) => {
|
const onDone: EleProTableDone<CmsNavigation> = ({data}) => {
|
||||||
navigationData.value = data;
|
navigationData.value = data;
|
||||||
|
expandAll()
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 刷新表格 */
|
/* 刷新表格 */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-button @click="add" type="primary" :disabled="!websiteId">添加字段</a-button>
|
<a-button @click="add" type="primary" >添加字段</a-button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
>
|
>
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="openEdit()">
|
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined />
|
<plus-outlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
>
|
>
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button type="primary" class="ele-btn-icon" :disabled="!websiteId" @click="openEdit()">
|
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined />
|
<plus-outlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
:accept="'image/*,application/*'"
|
:accept="'image/*,application/*'"
|
||||||
:customRequest="onUpload"
|
:customRequest="onUpload"
|
||||||
>
|
>
|
||||||
<a-button type="primary" :disabled="!websiteId" class="ele-btn-icon">
|
<a-button type="primary" class="ele-btn-icon">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<UploadOutlined />
|
<UploadOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
:maxlength="20"
|
:maxlength="20"
|
||||||
:disabled="isUpdate"
|
|
||||||
placeholder="请输入真实姓名"
|
placeholder="请输入真实姓名"
|
||||||
v-model:value="form.realName"
|
v-model:value="form.realName"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -133,16 +133,16 @@
|
|||||||
<template v-if="column.key === 'value'">
|
<template v-if="column.key === 'value'">
|
||||||
<div class="coupon-value">
|
<div class="coupon-value">
|
||||||
<template v-if="record.type === 10">
|
<template v-if="record.type === 10">
|
||||||
<span class="value-amount">¥{{ record.reducePrice?.toFixed(2) || '0.00' }}</span>
|
<span class="value-amount">¥{{ Number(record.reducePrice).toFixed(2) || '0.00' }}</span>
|
||||||
<div class="value-condition">满¥{{ record.minPrice?.toFixed(2) || '0.00' }}可用</div>
|
<div class="value-condition">满¥{{ Number(record.minPrice).toFixed(2) || '0.00' }}可用</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="record.type === 20">
|
<template v-else-if="record.type === 20">
|
||||||
<span class="value-discount">{{ record.discount }}折</span>
|
<span class="value-discount">{{ record.discount }}折</span>
|
||||||
<div class="value-condition">满¥{{ record.minPrice?.toFixed(2) || '0.00' }}可用</div>
|
<div class="value-condition">满¥{{ Number(record.minPrice)?.toFixed(2) || '0.00' }}可用</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="record.type === 30">
|
<template v-else-if="record.type === 30">
|
||||||
<span class="value-free">免费券</span>
|
<span class="value-free">免费券</span>
|
||||||
<div class="value-condition">满¥{{ record.minPrice?.toFixed(2) || '0.00' }}可用</div>
|
<div class="value-condition">满¥{{ Number(record.minPrice)?.toFixed(2) || '0.00' }}可用</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -272,10 +272,9 @@ const loading = ref(false);
|
|||||||
|
|
||||||
// 搜索表单
|
// 搜索表单
|
||||||
const searchForm = reactive<ShopCouponParam>({
|
const searchForm = reactive<ShopCouponParam>({
|
||||||
name: '',
|
keywords: '',
|
||||||
type: undefined,
|
name: undefined,
|
||||||
expireType: undefined,
|
type: 0
|
||||||
isExpire: undefined
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
@@ -467,7 +466,7 @@ const formatDate = (dateStr: string) => {
|
|||||||
|
|
||||||
const getUsagePercent = (record: ShopCoupon) => {
|
const getUsagePercent = (record: ShopCoupon) => {
|
||||||
if (record.totalCount === -1) return 0;
|
if (record.totalCount === -1) return 0;
|
||||||
return Math.round(((record.issuedCount || 0) / record.totalCount) * 100);
|
return Math.round(((record.issuedCount || 0) / Number(record.totalCount)) * 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getUsageColor = (record: ShopCoupon) => {
|
const getUsageColor = (record: ShopCoupon) => {
|
||||||
|
|||||||
@@ -92,17 +92,17 @@
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<!-- <a-col :span="12">-->
|
||||||
<a-form-item label="审核时间" name="auditTime" v-if="form.applyStatus === 20 || form.applyStatus === 30">
|
<!-- <a-form-item label="审核时间" name="auditTime" v-if="form.applyStatus === 20 || form.applyStatus === 30">-->
|
||||||
<a-date-picker
|
<!-- <a-date-picker-->
|
||||||
v-model:value="form.auditTime"
|
<!-- v-model:value="form.auditTime"-->
|
||||||
show-time
|
<!-- show-time-->
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
<!-- format="YYYY-MM-DD HH:mm:ss"-->
|
||||||
placeholder="请选择审核时间"
|
<!-- placeholder="请选择审核时间"-->
|
||||||
style="width: 100%"
|
<!-- style="width: 100%"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
</a-col>
|
<!-- </a-col>-->
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<a-row :gutter="16" v-if="form.applyStatus === 30">
|
<a-row :gutter="16" v-if="form.applyStatus === 30">
|
||||||
|
|||||||
Reference in New Issue
Block a user