优化推荐功能新增参数配置及上传工具

This commit is contained in:
wangqiao
2025-09-23 22:19:33 +08:00
parent aef8799652
commit 5b498724c4
9 changed files with 59 additions and 16 deletions

View File

@ -80,6 +80,7 @@ export interface pageRes {
previewPoint?: number previewPoint?: number
commentsPoint?: number commentsPoint?: number
hotPoint?: number hotPoint?: number
source?: number
}[] }[]
total: number total: number
} }

BIN
assets/images/yuan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/images/zhuan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,8 +1,9 @@
<template> <template>
<div class="relative mt-[34px] w-[100%]"> <div class="relative mt-[34px] w-[100%]">
<KlTabBar v-model="query.source" :data="tabBar" /> <KlTabBar v-model="query.source" :data="tabBar" />
<div class="absolute right-[0px] top-[0px] text-[16px] text-[#999999] font-normal" <div class="absolute right-[0px] top-[0px] text-[16px] text-[#999999] font-normal">
><span class="color-[#1A65FF]">{{ result?.total }}</span <el-button type="warning" class="mr-4px" @click="handleUpload">上传工具</el-button>
<span class="color-[#1A65FF]">{{ result?.total }}</span
>个筛选结果</div >个筛选结果</div
> >
<div class="content mt-[10px]"> <div class="content mt-[10px]">
@ -22,6 +23,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import type { pageRes, pageReq } from '~/api/upnew/types' import type { pageRes, pageReq } from '~/api/upnew/types'
import emptyImg from '~/assets/images/empty.png' import emptyImg from '~/assets/images/empty.png'
import useUserStore from '~/stores/user'
const query = defineModel<pageReq>('modelValue', { const query = defineModel<pageReq>('modelValue', {
required: true, required: true,
@ -45,6 +47,14 @@
value: 2, value: 2,
}, },
]) ])
const handleUpload = () => {
// 先判断登录
const store = useUserStore()
if (!store.token) {
return ElMessage.error('请先登录')
}
navigateTo('/upnew?drawType=1')
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@ -6,12 +6,17 @@
<div class="box-border p-[16px]"> <div class="box-border p-[16px]">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
<div> <div>
<div class="title mr-[38px] text-[16px] text-[#333333] font-bold">{{ props.itemInfo.title }}</div> <div class="title mr-[38px] text-[16px] text-[#333333] font-bold flex items-center" :title="props.itemInfo.title">
<img v-if="props.itemInfo.source === 2" src="~/assets/images/zhuan.png" alt="" srcset="" class="mr-[2px] w-[22px] relative bottom-[-4px]" />
<img v-if="props.itemInfo.source === 1" src="~/assets/images/yuan.png" alt="" srcset="" class="mr-[2px] w-[20px] relative bottom-[-4px]" />
{{ props.itemInfo.title }}
</div>
<div class="mt-[8px] text-[15px] text-[#999999] font-normal">by {{ props.itemInfo?.ownedUserIdInfo?.nickName }}</div> <div class="mt-[8px] text-[15px] text-[#999999] font-normal">by {{ props.itemInfo?.ownedUserIdInfo?.nickName }}</div>
<div class="mt-[4px] text-[13px] text-[#999999] font-normal">{{ dayjs(props.itemInfo.createTime).format('YYYY-MM-DD HH:mm:ss') }}</div>
</div> </div>
<div><img :src="props.itemInfo?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[40px] w-[40px] rd-[50%]" /></div> <div><img :src="props.itemInfo?.ownedUserIdInfo?.avatar" alt="" srcset="" class="h-[40px] w-[40px] rd-[50%]" /></div>
</div> </div>
<div class="mt-[24px] flex items-center justify-between"> <div class="mt-[14px] flex items-center justify-between">
<div class="flex items-center justify-between text-[14px] text-[#666666] font-normal"> <div class="flex items-center justify-between text-[14px] text-[#666666] font-normal">
<div class="mr-[9px] flex items-center"> <div class="mr-[9px] flex items-center">
<img src="~/assets/images/look.png" alt="" srcset="" class="mr-[2px] h-[17px]" /> <img src="~/assets/images/look.png" alt="" srcset="" class="mr-[2px] h-[17px]" />
@ -35,6 +40,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import dayjs from 'dayjs'
import type { PropType } from 'vue' import type { PropType } from 'vue'
import type { pageRes } from '~/api/upnew/types' import type { pageRes } from '~/api/upnew/types'
const props = defineProps({ const props = defineProps({

View File

@ -1,8 +1,9 @@
<template> <template>
<div class="relative mt-[34px] w-[100%]"> <div class="relative mt-[34px] w-[100%]">
<KlTabBar v-model="query.source" :data="tabBar" /> <KlTabBar v-model="query.source" :data="tabBar" />
<div class="absolute right-[0px] top-[0px] text-[16px] text-[#999999] font-normal" <div class="absolute right-[0px] top-[0px] text-[16px] text-[#999999] font-normal">
><span class="color-[#1A65FF]">{{ result?.total }}</span <el-button type="warning" class="mr-4px" @click="handleUpload">上传工具</el-button>
<span class="color-[#1A65FF]">{{ result?.total }}</span
>个筛选结果</div >个筛选结果</div
> >
<div class="content mt-[10px]"> <div class="content mt-[10px]">
@ -22,6 +23,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import type { pageRes, pageReq } from '~/api/upnew/types' import type { pageRes, pageReq } from '~/api/upnew/types'
import emptyImg from '~/assets/images/empty.png' import emptyImg from '~/assets/images/empty.png'
import useUserStore from '~/stores/user'
const query = defineModel<pageReq>('modelValue', { const query = defineModel<pageReq>('modelValue', {
required: true, required: true,
@ -44,6 +46,15 @@
value: 2, value: 2,
}, },
]) ])
const handleUpload = () => {
// 先判断登录
const store = useUserStore()
if (!store.token) {
return ElMessage.error('请先登录')
}
navigateTo('/upnew?drawType=3')
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@ -1,10 +1,11 @@
<template> <template>
<div class="relative mt-[34px] w-[100%]"> <div class="relative mt-[34px] w-[100%]">
<KlTabBar v-model="query.source" :data="tabBar" /> <KlTabBar v-model="query.source" :data="tabBar" />
<div class="absolute right-[0px] top-[0px] text-[16px] text-[#999999] font-normal" <div class="absolute right-[0px] top-[0px] text-[16px] text-[#999999] font-normal">
><span class="color-[#1A65FF]">{{ result?.total }}</span <el-button type="warning" class="mr-4px" @click="handleUpload">上传工具</el-button>
>个筛选结果</div <span class="color-[#1A65FF]">{{ result?.total }}</span>
> 个筛选结果
</div>
<div class="content mt-[10px]"> <div class="content mt-[10px]">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col v-for="(item, index) in result?.list" :key="index" :span="6"> <el-col v-for="(item, index) in result?.list" :key="index" :span="6">
@ -22,6 +23,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import type { pageRes, pageReq } from '~/api/upnew/types' import type { pageRes, pageReq } from '~/api/upnew/types'
import emptyImg from '~/assets/images/empty.png' import emptyImg from '~/assets/images/empty.png'
import useUserStore from '~/stores/user'
const query = defineModel<pageReq>('modelValue', { const query = defineModel<pageReq>('modelValue', {
required: true, required: true,
@ -34,7 +36,7 @@
const tabBar = ref([ const tabBar = ref([
{ {
label: '文本推荐', label: '文本推荐',
value: -1 value: -1,
}, },
{ {
label: '原创文本', label: '原创文本',
@ -45,6 +47,15 @@
value: 2, value: 2,
}, },
]) ])
const handleUpload = () => {
// 先判断登录
const store = useUserStore()
if (!store.token) {
return ElMessage.error('请先登录')
}
navigateTo('/upnew?drawType=2')
}
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@ -1,7 +1,7 @@
<!-- 工具箱详情页面 --> <!-- 工具箱详情页面 -->
<template> <template>
<KlNavTab /> <KlNavTab />
<div class="toolbox-detail w-[1019px] min-h-[374px] bg-[#FFFFFF] rounded-[12px] border border-solid border-[#EEEEEE] pa-[37px] pt-[20px] box-border ma-auto mt-[30px]"> <div class="toolbox-detail w-[1200px] min-h-[374px] bg-[#FFFFFF] rounded-[12px] border border-solid border-[#EEEEEE] pa-[37px] pt-[20px] box-border ma-auto mt-[30px]">
<div class="w-[100%]"> <div class="w-[100%]">
<h1 class="font-[Microsoft_YaHei] font-bold text-[24px] text-[#333333] leading-[21px]">工具箱使用详情</h1> <h1 class="font-[Microsoft_YaHei] font-bold text-[24px] text-[#333333] leading-[21px]">工具箱使用详情</h1>
<div class="flex items-center w-[100%] mt-[30px]"> <div class="flex items-center w-[100%] mt-[30px]">
@ -28,7 +28,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="w-[938px] h-[1px] bg-[#EEEEEE] rounded-[1px] my-[20px]"></div> <div class="w-[100%] h-[1px] bg-[#EEEEEE] rounded-[1px] my-[20px]"></div>
<div class="body"> <div class="body">
<p class="font-[Microsoft_YaHei] font-normal text-[14px] text-[#333333] leading-[26px]"> <p class="font-[Microsoft_YaHei] font-normal text-[14px] text-[#333333] leading-[26px]">
这里是工具箱的详细使用说明和描述内容您可以在这里添加关于该工具箱功能的详细介绍 这里是工具箱的详细使用说明和描述内容您可以在这里添加关于该工具箱功能的详细介绍

View File

@ -46,6 +46,10 @@
return route.query.type || 'add' return route.query.type || 'add'
}) })
const drawType = computed(() => {
return route.query.drawType || 1
})
const form = reactive<TcreateReq>({ const form = reactive<TcreateReq>({
activeName: 1, // 标签 activeName: 1, // 标签
id: '', // 图纸id id,示例值(24548) id: '', // 图纸id id,示例值(24548)
@ -172,9 +176,9 @@
const drawTypeRef = ref<InstanceType<typeof DrawType>>() const drawTypeRef = ref<InstanceType<typeof DrawType>>()
onMounted(() => { onMounted(() => {
// 初始化图纸类型 // 初始化图纸类型
drawTypeRef.value?.handleTypeChange(1) drawTypeRef.value?.handleTypeChange(Number(drawType.value))
// 初始化图纸类型 // 初始化图纸类型
form.type = 1 form.type = Number(drawType.value)
if (type.value !== 'add') { if (type.value !== 'add') {
getDetail() getDetail()