|
|
@ -21,12 +21,11 @@ |
|
|
|
<!-- <RightCircleOutlined />--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </template>--> |
|
|
|
<template v-if="form.images"> |
|
|
|
<template v-for="(item, index) in JSON.parse(form.images)" :key="index"> |
|
|
|
<template v-for="(item, index) in list" :key="index"> |
|
|
|
<div class="ad-item"> |
|
|
|
<a-image :preview="false" :src="item.url" width="100vw" /> |
|
|
|
<a-space class="ad-text" :size="10" direction="vertical"> |
|
|
|
<div class="title">{{ form.name }}</div> |
|
|
|
<div class="title">{{ item.title }}</div> |
|
|
|
<div class="desc">{{ form.comments }}</div> |
|
|
|
<div class="btn" |
|
|
|
><a-button |
|
|
@ -39,14 +38,13 @@ |
|
|
|
</a-space> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</a-carousel> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script setup lang="ts"> |
|
|
|
import { getAd } from '@/api/cms/ad'; |
|
|
|
import { getSide } from '@/api/cms/ad'; |
|
|
|
import useFormData from '@/utils/use-form-data'; |
|
|
|
import { Ad } from '@/api/cms/ad/model'; |
|
|
|
import {Ad, AdItem} from '@/api/cms/ad/model'; |
|
|
|
import { ref } from 'vue'; |
|
|
|
import { openNew } from '@/utils/common'; |
|
|
|
import { |
|
|
@ -58,9 +56,10 @@ import { storeToRefs } from 'pinia'; |
|
|
|
const themeStore = useThemeStore(); |
|
|
|
const { screenWidth } = storeToRefs(themeStore); |
|
|
|
const visible = ref<boolean>(false); |
|
|
|
const list = ref<AdItem[]>(); |
|
|
|
|
|
|
|
// 表单数据 |
|
|
|
const { form, assignFields } = useFormData<Ad>({ |
|
|
|
const { form } = useFormData<Ad>({ |
|
|
|
adId: undefined, |
|
|
|
name: '', |
|
|
|
adType: '图片广告', |
|
|
@ -86,8 +85,11 @@ const onChange = () => { |
|
|
|
}; |
|
|
|
|
|
|
|
const reload = () => { |
|
|
|
getAd(254).then((data) => { |
|
|
|
assignFields(data); |
|
|
|
getSide().then((data) => { |
|
|
|
if(data){ |
|
|
|
list.value = data.data; |
|
|
|
} |
|
|
|
// assignFields(data); |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|