修改bug

master
ihzero 2023-08-23 01:09:05 +08:00
parent 6e244d2fb4
commit 556d6f9889
8 changed files with 118 additions and 149 deletions

View File

@ -35,7 +35,7 @@
</div>
</div>
<template v-if="detail">
<AiAssistantFolat :content="detail.content"></AiAssistantFolat>
<AiAssistantFolat :content="aiContent"></AiAssistantFolat>
</template>
</div>
</template>
@ -48,6 +48,7 @@ import { useRouter, useRoute } from 'vue-router';
import { DateFormat } from '@/utils/format.js';
import AiAssistantFolat from '@/views/chat/components/ai-assistant-float.vue';
import { useWebsite } from '@/stores/website';
import { computed } from 'vue';
const website = useWebsite();
@ -64,6 +65,10 @@ const detail = ref();
const recommend = ref([]);
const placeholder = ref('数据加载中...');
const aiContent = computed(() => {
return `标题${detail.value?.title}作者${detail.value?.author}责编${detail.value?.editor}发布时间${DateFormat(new Date(detail.value?.published_at * 1000), 'yyyy.MM.dd') }内容${detail.value?.content}`
});
onMounted(() => {
getDetail();

View File

@ -19,9 +19,9 @@
:slidesPerView="'auto'"
:navigation="true"
:coverflowEffect="{
rotate: -10,
rotate: -20,
stretch: 0,
depth: 0,
depth: 60,
slideShadows: true,
}"
:pagination="true"

View File

@ -1,6 +1,9 @@
<template>
<div class="px-30px">
<div class="flex items-center justify-center mt-54px" v-if="sortList.length">
<div
class="flex items-center justify-center mt-54px"
v-if="sortList.length"
>
<svg-icon
@click="handlePrev"
class="text-white text-53px transform -rotate-90 cursor-pointer"
@ -17,7 +20,7 @@
:class="{ 'opacity-40': currentSortIndex === sortList.length - 1 }"
></svg-icon>
</div>
<div class="h-533px w-full border-1px border-[#A6A8AF] mt-3">
<div class="w-full h-full" id="myEcharts"></div>
</div>
@ -128,141 +131,36 @@ const setOption = (options) => {
const initChart = () => {
const data = toRaw(currentChart.value)
if (data) {
const { chart_options } = data
if (chart_options.type == 'line') lineChart(data)
if (chart_options.type == 'bar') barChart(data)
setChart(data)
}
}
const lineChart = (data) => {
const { chart_data, chart_options, title } = data
const setChart = (data) => {
const { chart_data, title } = data
const xAxis = chart_data.xAxis.list
const series = chart_data.data.filter((item) => item.list.some((value) => value !== null)).map((e) => {
return {
name: e.name,
type: chart_options.type,
color: chart_options.color,
smooth: true,
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: hexToRgba(chart_options.color ?? '#ffffff','0.3'),
},
{
offset: 0.8,
color: hexToRgba(chart_options.color ?? '#ffffff','0'),
},
],
false
),
shadowColor: 'rgba(54, 98, 254, 0.1)',
shadowBlur: 10,
},
},
symbol: 'circle',
symbolSize: 5,
data: e.list,
}
})
const series = chart_data.data
.filter((item) => item.list.some((value) => value !== null))
.map((e) => {
const { type } = e
if (type == 'line') return lineSeries(e)
if (type == 'bar') return barSeries(e)
})
setOption({
grid: {
left: '2%',
right: '3%',
top: '22%',
bottom: '2%',
containLabel: true,
},
tooltip: {
trigger: 'axis',
},
title: {
text: title,
left: '2%',
top: '3%',
legend: {
top: '4%',
right: '4%',
textStyle: {
color: '#fff',
fontSize: 18,
fontWeight: 'bold',
},
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxis,
axisLabel: {
color: 'rgba(255, 255, 255, .4)',
fontSize: 14,
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(65, 69, 72, 1)',
},
},
},
yAxis: {
type: 'value',
name: '单位',
position: 'left',
nameTextStyle: {
color: 'rgba(255, 255, 255, .4)',
fontSize: 14,
},
axisLabel: {
color: 'rgba(255, 255, 255, .4)',
fontSize: 14,
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(65, 69, 72, 1)',
},
},
splitLine: {
lineStyle: {
type: 'dashed',
color: 'rgba(255, 255, 255, .4)',
},
},
},
series: series,
})
}
const barChart = (data) => {
const { chart_data, chart_options, title } = data
const xAxis = chart_data.xAxis.list
const series = chart_data.data.filter((item) => item.list.some((value) => value !== null)).map((e) => {
return {
name: e.name,
type: chart_options.type,
color: chart_options.color,
smooth: true,
symbol: 'circle',
symbolSize: 5,
data: e.list,
}
})
setOption({
grid: {
left: '2%',
left: '4%',
right: '3%',
top: '22%',
bottom: '2%',
top: '20%',
bottom: '5%',
containLabel: true,
},
tooltip: {
@ -322,12 +220,60 @@ const barChart = (data) => {
})
}
function lineSeries(e) {
const { type, color, list, name } = e
return {
name: name,
type: type,
color: color,
smooth: true,
areaStyle: {
normal: {
color: new echarts.graphic.LinearGradient(
0,
0,
0,
1,
[
{
offset: 0,
color: hexToRgba(color ?? '#ffffff', '0.3'),
},
{
offset: 0.8,
color: hexToRgba(color ?? '#ffffff', '0'),
},
],
false
),
shadowColor: 'rgba(54, 98, 254, 0.1)',
shadowBlur: 10,
},
},
symbol: 'circle',
symbolSize: 5,
data: list,
}
}
function hexToRgba(hexColor,opacity) {
const hex = hexColor.replace('#', '')
const r = parseInt(hex.substring(0, 2), 16)
const g = parseInt(hex.substring(2, 4), 16)
const b = parseInt(hex.substring(4, 6), 16)
return `rgba(${r}, ${g}, ${b}, ${opacity})`
function barSeries(e) {
const { type, color, list, name } = e
return {
name: name,
type: type,
color: color,
smooth: true,
symbol: 'circle',
symbolSize: 5,
data: list,
}
}
function hexToRgba(hexColor, opacity) {
const hex = hexColor.replace('#', '')
const r = parseInt(hex.substring(0, 2), 16)
const g = parseInt(hex.substring(2, 4), 16)
const b = parseInt(hex.substring(4, 6), 16)
return `rgba(${r}, ${g}, ${b}, ${opacity})`
}
</script>

View File

@ -277,7 +277,7 @@ const sendMessage = async () => {
{
// prompt: message,
prompt:`"""
${content?.substring(0, 3900)}
${props.content?.substring(0, 3900)}
"""
Question: ${message}`
},

View File

@ -27,6 +27,9 @@
:as-raw-text="asRawText"
/>
<FileComponent :file="file" v-else/>
<div class="h-full" v-if="!inversion">
<SvgIcon @click="handleCopy" class="text-26px" name="ic_copy"></SvgIcon>
</div>
</div>
</div>
</div>
@ -35,7 +38,9 @@
import TextComponent from './text.vue'
import AvatarComponent from './avatar.vue'
import FileComponent from './file.vue'
import { copyToClip } from '@/utils/copy'
import { ref } from 'vue'
import { showToast } from 'vant'
const props = defineProps({
type: {
type: String,
@ -60,4 +65,14 @@ const props = defineProps({
})
const asRawText = ref(props.inversion)
const handleCopy = () => {
copyToClip(props.text)
.then((res) => {
showToast('复制成功~')
})
.catch(() => {
showToast('复制失败~')
})
}
</script>

View File

@ -22,9 +22,9 @@
<div class="w-479px h-full flex flex-col overflow-hidden">
<div class="h-100px"></div>
<div
class="bg-gradient-to-b to-[#101011] from-[#414548] flex-1 border-t-7px border-[#3662FE] flex flex-col items-center overflow-y-auto"
class="bg-gradient-to-b to-[#101011] from-[#414548] flex-1 flex flex-col items-center overflow-y-auto"
>
<SilderBtn @click="openTemplateModal">
<SilderBtn class="!bg-[#3662FE]" @click="openTemplateModal">
<template #icon>
<SvgIcon class="text-white text-35px" name="dp"></SvgIcon>
</template>

View File

@ -22,9 +22,7 @@
name="stop"
class="text-white text-26px cursor-pointer mr-28px"
></SvgIcon>
<div class="flex-1 text-right text-22px">
剩余字数:{{ surplus }}
</div>
<div class="flex-1 text-right text-22px">剩余字数:{{ surplus }}</div>
</div>
<van-field
ref="inputRef"
@ -113,8 +111,9 @@ const isLogin = computed(() => {
})
const surplus = computed(() => {
const { words_count=0 ,words_used = 0} = userInfo.userData?.equity ?? {}
return words_count - words_used
const { words_count = 0, words_used = 0 } = userInfo.userData?.equity ?? {}
const count = words_count - words_used
return count < 0 ? 0 : count
})
const authModal = useAuthModal()
@ -141,9 +140,6 @@ const fileLoading = ref(false)
const currentChart = computed(() => chatStore.getCurrentChat)
async function handleFileChange(file) {
if (!isLogin.value) {
authModal.setAuthModalType('login')
@ -260,7 +256,7 @@ function handleSubmit() {
async function onConversation(action = 'next', file, fileText) {
let message = inputValue.value || fileText
if (loading.value) return
if (!isLogin) {
authModal.setAuthModalType('login')
@ -429,6 +425,7 @@ onMounted(async () => {
if (inputRef.value) {
inputRef.value.focus()
}
userInfo.getUserInfo()
await chatStore.getChat(uuid)
scrollToBottom()
})

View File

@ -21,10 +21,13 @@
</div>
</div>
<div class="flex px-43px mt-92px">
<div class="mr-54px">
<div class="mr-40px">
<div class="text-27px font-bold">虚拟人直播</div>
<div class="mt-31px text-22px text-[#C2C5CA] leading-29px">
一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字
<p>成本节省价格低品质好一次定制终生使用节省90%成本</p>
<p>无须布场随时随地开播24小时直播</p>
<p>设备简单只需一部手机+一台电脑</p>
<p>操作简便傻瓜式操作小白也能轻松上手</p>
</div>
<div class="mt-43px">
<van-button
@ -63,7 +66,10 @@
<div class="ml-54px">
<div class="text-27px font-bold">短视频创作</div>
<div class="mt-31px text-22px text-[#C2C5CA] leading-29px">
一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字一些相关的描述文字
<p>简单易懂操作:一个视频=1段文案+1个数字人+一键合成</p>
<p>视频产出快速: 制作一个真人口播视频最快仅需 1分钟</p>
<p>随时随地修改:数字人视频随时修改文本随时生成</p>
<p>虚拟人更加智能:一个数字人可更换不同语种不同声线不同情感音色</p>
</div>
<div class="mt-43px">
<van-button
@ -209,7 +215,7 @@
@click="onPlay(item)"
v-for="(item, i) in videos"
:key="i"
class="w-193px mx-11px flex-none"
class="w-193px h-360px mx-11px flex-none"
:src="item.img"
alt=""
/>