Browse Source

样式调整

master
py 9 months ago
parent
commit
0cb51f8bd6
  1. 5
      src/views/Banner/BannerForm.vue
  2. 7
      src/views/Banner/Index.vue
  3. 14
      src/views/Board/components/addBarrage.vue
  4. 18
      src/views/Board/components/welcome.vue

5
src/views/Banner/BannerForm.vue

@ -117,7 +117,7 @@ const formItemList = computed(()=>{
},
{label: '姓名', prop: 'fullName',placeholder:'格式:张三,李四,xx'},
{label: '祝福弹幕', prop: 'barrage', type: 'textarea'},
{label: '背景图片', prop: 'backgroundImages', type: 'image'},
{label: '背景图片', prop: 'backgroundImages', type: 'image',limit: 4},
{label: '个人图片', prop: 'images', type: 'image', limit: 6, hide:formData.value.category === 1},
],
4: [
@ -149,7 +149,7 @@ const getAIContent = async () => {
if (AILoading.value) return
try {
AILoading.value = true
const res = await BannerApi.getContentBanner(`帮我生成三句生日祝福,姓名叫${formData.value.fullName},名字可能为空,空就直接祝福,返回数组格式,一个大数组,嵌套2个数组,里面的数组是生成的祝福语句,可以混一起,其他多余的字符不要,前面加个类似🎉 🌼 🎂 🎈 🌟 💐 这种小图标,数组格式不是字符串`)
const res = await BannerApi.getContentBanner(`帮我生成生日祝福,返回数组格式,一个大数组,嵌套2个数组,里面的数组是生成的祝福语句,可以混一起,其他多余的字符不要,前面加个类似🎉 🌼 🎂 🎈 🌟 💐 这种小图标,数组格式不是字符串,姓名叫${formData.value.fullName},一人两条祝福,,名字可能为空,空就直接三条生日祝福。`)
console.log(res, '===')
formData.value.barrage = res
AILoading.value = false
@ -173,7 +173,6 @@ defineExpose({open}) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const submitForm = async () => {
//
console.log(formData.value,'===category')
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return

7
src/views/Banner/Index.vue

@ -79,6 +79,13 @@
<img :src="src" />
</div>
</div>
<div v-else-if="item.type === 3" class="content-box">
<div class="img-list">
<img class="img-li" v-if="item.backgroundImages.length" :src="item.backgroundImages[0]" />
</div>
<div class="title" v-if="item.title">{{ item.title }}</div>
<div class="content" v-if="item.content">{{ item.content }}</div>
</div>
<div v-else class="content-box">
<div class="img-list">
<img class="img-li" v-for="(src, i) in item.backgroundImages" :key="i" :src="src" />

14
src/views/Board/components/addBarrage.vue

@ -1,7 +1,7 @@
<template>
<div class="container">
<!-- 弹幕容器 -->
<div class="barrage-container" v-if="boardData.type === 3">
<div class="barrage-container" v-if="false && boardData.type === 3">
<marquee direction="left" scrollamount="10" v-for="(item,index) in barrageList" :key="index">
<div class="div-box">
<span v-for="(v,i) in item" :key="i">{{ v }}</span>
@ -20,9 +20,9 @@
<script setup lang="ts">
import { ref } from 'vue'
import { pushBannerBarrage } from '@/api/banner'
import {isArray} from "min-dash";
import {getAccessToken} from "@/utils/auth";
import {useWebSocket} from "@vueuse/core";
// import {isArray} from "min-dash";
// import {getAccessToken} from "@/utils/auth";
// import {useWebSocket} from "@vueuse/core";
const inputText = ref('')
const route = useRoute()
@ -37,7 +37,7 @@ const props = defineProps({
},
});
const barrageList = ref([])
watch(() => props.boardData, (nv) => {
/*watch(() => props.boardData, (nv) => {
if (nv) {
if(nv.barrage){
barrageList.value = JSON.parse(nv.barrage) || []
@ -46,7 +46,6 @@ watch(() => props.boardData, (nv) => {
barrageList.value[index % 2].push(v)
})
}
console.log(barrageList.value,'===')
}
}
}, { immediate: true,deep: true });
@ -90,12 +89,13 @@ watch(
console.error(error);
}
}
);
);*/
const sendBarrage = async () => {
if (!inputText.value.trim()) return
const params = { code,content:inputText.value }
await pushBannerBarrage(params)
inputText.value = ''
ElMessage.success('发送成功')
}
</script>

18
src/views/Board/components/welcome.vue

@ -18,9 +18,9 @@
<div class="content">{{boardData.content}}</div>
</div>
<template v-if="boardData.type === 3">
{{previewUrl}} 11313131
<div class="qr-box">
<Qrcode :options="{margin:0}" :width="100" :text="previewUrl" logo="/logo.png" />
<Qrcode :options="{margin:0}" :width="60" :text="previewUrl" logo="/logo.png" />
<span>扫码送祝福</span>
</div>
<!-- 弹幕容器 -->
<div class="barrage-container">
@ -124,14 +124,19 @@ watch(
top: 16vh;
padding: 0 4vw;
box-sizing: border-box;
font-family: 宋体;
color: #fdf76d;
font-weight: bold;
.title{
font-size: 6.5vw;
font-size: 8vw;
margin-bottom: 5vh;
text-align: center;
letter-spacing: 1vw;
}
.content{
font-size: 4.2vw;
text-align: center;
letter-spacing: 0.5vw;
}
}
.qr-box{
@ -139,6 +144,13 @@ watch(
z-index: 2;
top: 2vh;
right: 1vw;
display: flex;
flex-flow: column;
align-items: center;
font-size: 1vw;
span{
margin-top: 1vh;
}
}
/* 弹幕区域 */
.barrage-container {

Loading…
Cancel
Save