修复若干问题1-32
This commit is contained in:
parent
37c391713f
commit
57df3c90bf
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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' ? (
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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}')`,
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -90,7 +90,7 @@ export default defineComponent(() => {
|
|||
)}
|
||||
>
|
||||
<OhVueIcon name="md-stars-twotone" fill="white" scale={1.3} />
|
||||
休闲
|
||||
轻闲
|
||||
</div>
|
||||
<svg
|
||||
width="200"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ export default defineStore('statistic', () => {
|
|||
}).then(() => {
|
||||
|
||||
list.value = []
|
||||
message.success('发送统计成功')
|
||||
})
|
||||
}, 2500) //
|
||||
watch(list, (newValue) => {
|
||||
|
|
|
@ -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
|
||||
})
|
||||
}
|
||||
)
|
||||
|
|
|
@ -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)}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue