|
|
@@ -110,7 +110,7 @@
|
|
|
<el-switch v-model="bannerForm.showText" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="图片" required>
|
|
|
- <image-upload v-model="bannerForm.coverImage" :limit="1" />
|
|
|
+ <upload-image v-model="bannerForm.coverImage" :limit="1" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="描述" required>
|
|
|
<el-input v-model="bannerForm.advertBrief" type="textarea" :rows="3" placeholder="请输入描述" />
|
|
|
@@ -194,11 +194,11 @@ const defaultBannerUrl = 'https://via.placeholder.com/200x300/1a237e/FFFFFF?text
|
|
|
// 左侧大图配置
|
|
|
const bannerConfig = ref({ id: null as number | null, imageUrl: '', imageOssId: '', link: '', title: '', brief: '', showText: false });
|
|
|
const bannerDialog = reactive({ visible: false });
|
|
|
-const bannerForm = reactive({
|
|
|
- id: null as number | null,
|
|
|
- advertTitle: '',
|
|
|
- coverImage: '',
|
|
|
- advertUrl: '',
|
|
|
+const bannerForm = reactive({
|
|
|
+ id: null as number | null,
|
|
|
+ advertTitle: '',
|
|
|
+ coverImage: '',
|
|
|
+ advertUrl: '',
|
|
|
advertBrief: '',
|
|
|
showText: false,
|
|
|
advertPosition: ADVERT_POSITION,
|
|
|
@@ -219,10 +219,10 @@ const loadBannerConfig = async () => {
|
|
|
if (ossRes.data && ossRes.data.length > 0) displayUrl = ossRes.data[0].url;
|
|
|
} catch (e) { console.error('获取图片URL失败', e); }
|
|
|
}
|
|
|
- bannerConfig.value = {
|
|
|
- id: data.id,
|
|
|
- imageUrl: displayUrl,
|
|
|
- imageOssId: ossId,
|
|
|
+ bannerConfig.value = {
|
|
|
+ id: data.id,
|
|
|
+ imageUrl: displayUrl,
|
|
|
+ imageOssId: ossId,
|
|
|
link: data.advertUrl || '',
|
|
|
title: data.advertTitle || '',
|
|
|
brief: data.advertBrief || '',
|
|
|
@@ -245,10 +245,10 @@ const handleEditBanner = async () => {
|
|
|
if (coverImageValue && typeof coverImageValue === 'string' && coverImageValue.startsWith('http')) {
|
|
|
coverImageValue = bannerConfig.value.imageOssId || '';
|
|
|
}
|
|
|
- Object.assign(bannerForm, {
|
|
|
- id: data.id,
|
|
|
+ Object.assign(bannerForm, {
|
|
|
+ id: data.id,
|
|
|
advertTitle: data.advertTitle || '',
|
|
|
- coverImage: coverImageValue,
|
|
|
+ coverImage: coverImageValue,
|
|
|
advertUrl: data.advertUrl || '',
|
|
|
advertBrief: data.advertBrief || '',
|
|
|
showText: data.isShow === '1',
|
|
|
@@ -258,10 +258,10 @@ const handleEditBanner = async () => {
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
- Object.assign(bannerForm, {
|
|
|
- id: null,
|
|
|
+ Object.assign(bannerForm, {
|
|
|
+ id: null,
|
|
|
advertTitle: '',
|
|
|
- coverImage: '',
|
|
|
+ coverImage: '',
|
|
|
advertUrl: '',
|
|
|
advertBrief: '',
|
|
|
showText: true,
|
|
|
@@ -300,12 +300,12 @@ const loadHeaderConfig = async () => {
|
|
|
const res = await getFloorTitle(TITLE_ID);
|
|
|
if (res.data) {
|
|
|
const data = res.data;
|
|
|
- headerConfig.value = {
|
|
|
- id: data.id,
|
|
|
- title: data.title || '大牌推荐',
|
|
|
- subtitle: data.subtitle || '甄选大牌,优质好品',
|
|
|
- linkText: data.linkWord || '查看更多品牌信息',
|
|
|
- linkUrl: data.linkUrl || ''
|
|
|
+ headerConfig.value = {
|
|
|
+ id: data.id,
|
|
|
+ title: data.title || '大牌推荐',
|
|
|
+ subtitle: data.subtitle || '甄选大牌,优质好品',
|
|
|
+ linkText: data.linkWord || '查看更多品牌信息',
|
|
|
+ linkUrl: data.linkUrl || ''
|
|
|
};
|
|
|
}
|
|
|
} catch (error) { console.error('加载标题配置失败', error); }
|
|
|
@@ -315,12 +315,12 @@ const handleEditHeader = () => { Object.assign(headerForm, headerConfig.value);
|
|
|
|
|
|
const saveHeaderConfig = async () => {
|
|
|
try {
|
|
|
- const data = {
|
|
|
- id: headerForm.id,
|
|
|
- title: headerForm.title,
|
|
|
- subtitle: headerForm.subtitle,
|
|
|
- linkWord: headerForm.linkText,
|
|
|
- linkUrl: headerForm.linkUrl
|
|
|
+ const data = {
|
|
|
+ id: headerForm.id,
|
|
|
+ title: headerForm.title,
|
|
|
+ subtitle: headerForm.subtitle,
|
|
|
+ linkWord: headerForm.linkText,
|
|
|
+ linkUrl: headerForm.linkUrl
|
|
|
};
|
|
|
if (headerForm.id) await updateFloorTitle(data);
|
|
|
else await addFloorTitle(data);
|
|
|
@@ -592,14 +592,14 @@ onMounted(() => { loadHeaderConfig(); loadBannerConfig(); loadRecommendId().then
|
|
|
|
|
|
&:hover { background: #fafafa; }
|
|
|
|
|
|
- .close-icon {
|
|
|
- position: absolute;
|
|
|
- top: 8px;
|
|
|
- right: 8px;
|
|
|
- font-size: 18px;
|
|
|
- color: #999;
|
|
|
- cursor: pointer;
|
|
|
- &:hover { color: #f56c6c; }
|
|
|
+ .close-icon {
|
|
|
+ position: absolute;
|
|
|
+ top: 8px;
|
|
|
+ right: 8px;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #999;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover { color: #f56c6c; }
|
|
|
}
|
|
|
|
|
|
.sort-icon {
|
|
|
@@ -650,16 +650,16 @@ onMounted(() => { loadHeaderConfig(); loadBannerConfig(); loadRecommendId().then
|
|
|
background: #fff;
|
|
|
border-radius: 4px;
|
|
|
|
|
|
- .search-title {
|
|
|
- font-size: 14px;
|
|
|
- font-weight: 500;
|
|
|
- color: #333;
|
|
|
+ .search-title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333;
|
|
|
padding: 12px 20px;
|
|
|
border-bottom: 1px solid #e8e8e8;
|
|
|
}
|
|
|
- .search-bar {
|
|
|
- display: flex;
|
|
|
- gap: 10px;
|
|
|
+ .search-bar {
|
|
|
+ display: flex;
|
|
|
+ gap: 10px;
|
|
|
padding: 16px 20px;
|
|
|
}
|
|
|
}
|