修复若干问题1-32

This commit is contained in:
expdsn 2024-11-18 18:47:31 +08:00
parent 37c391713f
commit 57df3c90bf
17 changed files with 154 additions and 114 deletions

View File

@ -32,6 +32,7 @@
"dayjs": "^1.11.13",
"echarts": "^5.5.1",
"gsap": "^3.12.5",
"js-base64": "^3.7.7",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"lunar-typescript": "^1.7.5",

View File

@ -352,7 +352,7 @@ export default defineComponent(() => {
text: block.text,
background: block.background,
color: block.color,
type: block.color ? 1 : 0
type: !block.icon ? 1 : 0
}
router.go('global-adder')
useAdderPageStore().type = 2

View File

@ -36,7 +36,7 @@ export default defineStore('adderPage', () => {
const isSearch = ref(false)
const widgetSearchWords = ref('')
const gameSearch = ref('')
const editBlockItem = ref<EditBlockItemType | null >(null)
const editBlockItem = ref<EditBlockItemType | null>(null)
request<HotAppCategoryType[]>('GET', '/api/app/hotAppTypes').then((res) => {
categoryList.value = res.map((el) => ({
id: el.id,
@ -64,9 +64,10 @@ export default defineStore('adderPage', () => {
}
const search = (keywords: string) => {
if (keywords === '') {
if (!keywords) {
if (isSearch.value) getApps(selectType.value)
isSearch.value = false
getApps(selectType.value)
return
}
isSearch.value = true

View File

@ -23,22 +23,7 @@ export default defineComponent(() => {
const settings = useSettingsStore()
return () => (
<div class="absolute left-0 top-0 w-full h-full p-4 overflow-y-auto scrollbar-hide">
{/* <SettingItem
noBg
v-slots={{
label: () => <div></div>
}}
>
<Select
class="w-[100px]"
options={[
{ label: '游戏', value: 0 },
{ label: '工作', value: 1 },
{ label: '休闲', value: 2 }
]}
v-model:value={selected.value}
/>
</SettingItem> */}
<div class="px-4">
<div class="h-[180px]">
{layout.background.video && layout.background.type !== 'own' ? (

View File

@ -29,7 +29,7 @@ const BgContent = defineComponent({
}}
>
{props.video ? (
<video src={props.video} class="w-full h-full" muted />
<video autoplay src={props.video} class="w-full h-full" muted />
) : (
<div
class="w-full h-full bg-center bg-cover bg-no-repeat"

View File

@ -27,10 +27,12 @@ export default function useResource(tag: Ref<string>, type: string) {
}
return
}
if (val.startsWith('http')) {
// 内源
if (val.startsWith(ossCdnBase)) {
// 地址后缀
const suffix = val.split('.').pop()
if (!suffix) {
return
@ -38,6 +40,7 @@ export default function useResource(tag: Ref<string>, type: string) {
if (videoArr.includes(suffix)) {
// 内部视频
// 先显示截图,再去数据库看是否有存货
resource.video = ''
resource.image = val + '?x-oss-process=video/snapshot,t_0,f_jpg,m_fast'
resource.brief = val + '?x-oss-process=video/snapshot,t_0,f_jpg,w_400,h_225,m_fast'
@ -45,10 +48,13 @@ export default function useResource(tag: Ref<string>, type: string) {
if (!res) return
const item = res.find((item) => item.tag === val)
if (item) {
console.log('是是视频');
resource.video = URL.createObjectURL(item.file)
resource.type = 'local'
} else {
// 不存在,需要存入
fetch(val)
.then((res) => res.blob())
.then((blob) => {
@ -61,6 +67,7 @@ export default function useResource(tag: Ref<string>, type: string) {
})
}
})
} else {
// 图片
resource.image = val

View File

@ -115,11 +115,12 @@ export default defineComponent(() => {
</div>
<div
class={
'mt-2 relative appearance-none rounded-lg h-[124px] bg-white/10 ' + (isGame.value ? 'bg-white/10 text-white' : 'bg-black/5 text-black/60')
'mt-2 relative appearance-none rounded-lg h-[124px] ' +
(isGame.value ? 'bg-white/10 text-white' : 'bg-black/5 text-black/60')
}
>
<textarea
placeholder='在此输入您的问题,并可以添加图片,方便更清晰的描述问题,我们会尽快帮您解决,感谢您的反馈'
placeholder="在此输入您的问题,并可以添加图片,方便更清晰的描述问题,我们会尽快帮您解决,感谢您的反馈"
maxlength={80}
v-model={data.description}
class="bg-transparent no-textarea w-full p-2 appearance-none resize-none placeholder:text-[14px] "
@ -141,7 +142,7 @@ export default defineComponent(() => {
<ImageUploader width={38} v-model:value={item.value} />
))}
</div>
<span class={"absolute right-2 bottom-2"}>{data.description.length}/80</span>
<span class={'absolute right-2 bottom-2'}>{data.description.length}/80</span>
</div>
<div class="mt-4"></div>
<div class="text-sm">便</div>
@ -169,13 +170,16 @@ export default defineComponent(() => {
await request('POST', '/api/feedback', {
data: {
content: data.description,
qq: data.qq,
email: data.qq,
phone: data.phone,
imgs: data.images
},
returnType: 'text'
})
message.success('提交成功')
list.forEach(item=> {
item.value = ''
})
Object.assign(data, { ...defaultData })
}}
class="mt-4 text-center rounded py-1 cursor-pointer bg-[#ffa93d] text-white"

View File

@ -31,13 +31,13 @@ export default defineComponent({
jump(props.block.link)
}}
style={{
backgroundColor: props.block.text ? props.block.background || 'white' : 'transparent',
backgroundColor: !props.block.icon ? props.block.background || 'white' : 'transparent',
color: props.block.color || 'black',
backgroundImage: props.block.icon ? `url('${props.block.icon}')` : '',
fontSize: props.dock ? '16px' : props.brief ? '12px' : 'calc(var(--block-size) / 5)'
}}
>
<div>{props.brief ? props.block.text[0] : props.block.text}</div>
{!props.block.icon && <div>{props.brief ? props.block.text[0] : props.block.text}</div>}
</div>
)
} else {

View File

@ -3,6 +3,9 @@ import { Button } from 'ant-design-vue'
import clsx from 'clsx'
import { computed, defineComponent, ref } from 'vue'
import useLayoutStore from '../useLayoutStore'
import useUserStore from '@/user/useUserStore'
import useTomatoStore from '@/widgets/work/useTomatoStore'
import useNotepadStore from '@/widgets/notepad/useNotepadStore'
export default defineComponent({
setup() {
@ -15,49 +18,82 @@ export default defineComponent({
<div class="p-4 flex flex-col ">
<SettingItem
v-slots={{
label: () => <div ></div>
label: () => <div></div>
}}
>
<Button type="primary" onClick={() => {
open.value = true
}}></Button>
<Button
type="primary"
onClick={() => {
open.value = true
}}
>
</Button>
</SettingItem>
<p class={'text-[#666] text-[12px]'}></p>
{
open.value &&
<div class={"w-[300px] h-[210px] absolute rounded-2xl right-[-310px] z-10 bg-[#2c2e3e]"} style={
isGame.value ?
{
backgroundImage: `url('/tab/bg/addBorder.png')`,
backgroundSize: '100% 100%',
backgroundColor: '#2c2e3e'
} : {}}>
<div class={"flex flex-col w-full h-full p-7 border-b-[1px] items-center justify-between"}>
<span class={isGame.value ? "" : ""}></span>
<div class={clsx("w-full h-[1px]", isGame.value ? " bg-white/20" : "bg-black/20")}></div>
<span class={clsx("text-[14px] leading-[20px] mb-2 text-center", isGame.value ? "text-[#fff9]" : "")}></span>
<div class={"flex justify-between w-full"}>
{open.value && (
<div
class={clsx(
'w-[300px] h-[210px] absolute rounded-2xl right-[-310px] z-10 ',
isGame.value ? 'bg-[#2c2e3e]' : 'bg-white'
)}
style={
isGame.value
? {
backgroundImage: `url('/tab/bg/addBorder.png')`,
backgroundSize: '100% 100%',
backgroundColor: '#2c2e3e'
}
: {}
}
>
<div
class={'flex flex-col w-full h-full p-7 border-b-[1px] items-center justify-between'}
>
<span class={isGame.value ? '' : ''}></span>
<div
class={clsx('w-full h-[1px]', isGame.value ? ' bg-white/20' : 'bg-black/20')}
></div>
<span
class={clsx(
'text-[14px] leading-[20px] mb-2 text-center',
isGame.value ? 'text-[#fff9]' : 'text-[#666]'
)}
>
</span>
<div class={'flex justify-between w-full'}>
<button
onClick={() => {
layout.resetAll()
useUserStore().logout()
useTomatoStore().reset()
useNotepadStore().reset()
open.value = false
}}
class={clsx("w-[118px] rounded-lg py-1 flex justify-center", isGame.value ? "bg-white/20" : "")}></button>
class={clsx(
'w-[118px] rounded-lg py-1 flex justify-center',
isGame.value ? 'bg-white/20' : 'bg-black/20 text-white'
)}
>
</button>
<button
onClick={() => {
open.value = false
}}
class={clsx("w-[118px] rounded-lg py-1 flex justify-center", isGame.value ? "bg-[#ff7372]" : "")}></button>
class={clsx(
'w-[118px] rounded-lg py-1 flex justify-center ',
isGame.value ? 'bg-[#ff7372]' : 'bg-[#ff7372] text-white'
)}
>
</button>
</div>
</div>
</div>
}
</div >
)}
</div>
)
}
})

View File

@ -15,12 +15,12 @@ export const DefaultPageSetting = [
desct: '聚合多类游戏工具,以及 资讯、排行榜等'
},
{
name: '工作',
name: '工作',
backgroundUrl:
'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/b82fd47c-24c1-4f58-b0db-51414b3bdda4.webp',
contentUrl:
'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/7e4cf74a-85cb-4e39-9e61-385b222ac8c4.webp',
desct: '结合番茄计时法等效率工具,让您可以高效学'
desct: '结合番茄计时法等效率工具,让您可以高效学'
},
{
name: '轻娱',
@ -57,7 +57,7 @@ export default defineComponent(() => {
<Transition>
{show.value && (
<div
class="w-full h-screen bg-black/60 "
class="w-full h-screen bg-white "
onClick={() => { }}
style={{
backgroundImage: `url('${DefaultPageSetting[selectMode.value].backgroundUrl}')`,

View File

@ -6,6 +6,7 @@ import debounce from 'lodash/debounce'
import { aIUrl, translateUrl } from '@/config'
import request from '@/utils/request'
import useStatisticStore from '@/utils/useStatisticStore'
import { Base64 } from "js-base64"
export type SearchAdType = {
name: string
icon: string
@ -39,15 +40,12 @@ export default defineStore('search', () => {
searchStr,
(val) => {
if (!val) return
fetch(
`${import.meta.env.PROD ? 'https://suggestion.baidu.com/su' : '/baiduSuggestion'}?wd=${val}&ie=utf-8&p=3&cb=j`
)
.then((res) => res.text())
.then((res: string) => {
const list = res.match(/(?<=s:\[").*(?=\]\})/g)?.[0]?.split('","')
if (list) {
sugList.value = list
}
request<{
list: string[]
}>('GET', `/api/lookUp/${Base64.encode(val)}`,)
.then(res => {
// const list = res.match(/(?<=s:\[").*(?=\]\})/g)?.[0]?.split('","')
sugList.value = res.list
}) as Promise<string[]>
},
{
@ -82,7 +80,7 @@ export default defineStore('search', () => {
searchConfig.addHistory(str)
searchStr.value = ''
jump(searchConfig.current.url + str)
useStatisticStore().send({
widget: 'search',
action: 'search',

View File

@ -90,7 +90,7 @@ export default defineComponent(() => {
)}
>
<OhVueIcon name="md-stars-twotone" fill="white" scale={1.3} />
</div>
<svg
width="200"

View File

@ -265,17 +265,13 @@ body {
.background-enter-active,
.background-leave-active {
transform: scale(1);
opacity: 1;
transition:
transform 0.6s cubic-bezier(0.47, 1.64, 0.41, 0.8),
opacity 0.6s ease-out;
}
.background-enter-from {
transform: scale(1.25);
opacity: 0;
transform: scale(1.2);
}
.background-leave-to {
transform: scale(1);
opacity: 0;
}

View File

@ -30,7 +30,6 @@ export default defineStore('statistic', () => {
}).then(() => {
list.value = []
message.success('发送统计成功')
})
}, 2500) //
watch(list, (newValue) => {

View File

@ -1,9 +1,9 @@
import { defineStore } from "pinia";
import { reactive } from "vue";
import { v4 as uuid } from "uuid"
import dayjs from "dayjs";
import { defineStore } from 'pinia'
import { reactive } from 'vue'
import { v4 as uuid } from 'uuid'
import dayjs from 'dayjs'
export const DEFALUT_DATA = {
content: `
content: `
FatfoxTab新标签页平台!
@ -104,34 +104,43 @@ FatfoxTab新标签页共分为四个模式
...
`,
title: "FatFoxTab指南",
date: 1730877843004,
id: "defautId"
};
export type NotepadItem = {
title: string
content: string
id: string
date: number
pin: boolean
title: 'FatFoxTab指南',
date: 1730877843004,
id: 'defautId',
pin: false
}
export default defineStore("notepad", () => {
export type NotepadItem = {
title: string
content: string
id: string
date: number
pin: boolean
}
export default defineStore(
'notepad',
() => {
const state = reactive({
list: [DEFALUT_DATA] as NotepadItem[]
list: [DEFALUT_DATA] as NotepadItem[]
})
const addNewNote = () => {
state.list.unshift({
id: uuid(),
title: '',
date: dayjs().valueOf(),
content: '',
pin: false
})
state.list.unshift({
id: uuid(),
title: '',
date: dayjs().valueOf(),
content: '',
pin: false
})
}
const reset = () => {
state.list = [DEFALUT_DATA]
}
return {
state,
addNewNote
state,
addNewNote,
reset
}
}, {
},
{
persist: true
})
}
)

View File

@ -26,7 +26,7 @@ export default defineComponent(() => {
'w-full bg-white/20 text-center rounded text-[14px] overflow-hidden text-ellipsis whitespace-nowrap'
}
>
{store.state.list[0] ? store.state.list[0].title : '无目标'}
{store.state.list ? store.state.list.filter((val) => !val.isCompleted).shift()?.title : '无目标'}
</div>
<span class={'text-[42px] mb-1'}>
{store.state.beginTime < 0 ? '15:00' : formatSeconds(store.remainingTime)}

View File

@ -39,15 +39,16 @@ export const musicList = [
music: 'https://newfatfox.oss-cn-beijing.aliyuncs.com/admin/music/AWonderfulStore.mp3'
}
]
const initData = {
list: [] as TomatoTarget[],
timeList: [] as number[],
isPlaying: false as boolean,
selectMusic: 0,
isStart: false as boolean,
beginTime: -1 as number,
}
export default defineStore("work", () => {
const state = reactive({
list: [] as TomatoTarget[],
timeList: [] as number[],
isPlaying: false as boolean,
selectMusic: 0,
isStart: false as boolean,
beginTime: -1 as number,
})
const state = reactive({ ...initData })
const audio = new Audio()
const time = useTimeStore()
const remainingTime = computed(() => {
@ -91,7 +92,7 @@ export default defineStore("work", () => {
}
watch(remainingTime, (val) => {
if (val < 0) {
stopTomatoTime()
@ -117,7 +118,9 @@ export default defineStore("work", () => {
return state.list.filter(val => dayjs(val.finishTime).isSame(dayjs().subtract(1, 'day'), 'day') && val.isCompleted).length
})
const reset = () => {
Object.assign(state, { ...initData })
}
return {
state,
openShowModel,
@ -131,7 +134,8 @@ export default defineStore("work", () => {
yestodayHour,
todayFinishTarget,
yesFinishTarget,
setTrack
setTrack,
reset
}
}, {
persist: true