修复若干问题1-32
This commit is contained in:
parent
37c391713f
commit
57df3c90bf
|
@ -32,6 +32,7 @@
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"echarts": "^5.5.1",
|
"echarts": "^5.5.1",
|
||||||
"gsap": "^3.12.5",
|
"gsap": "^3.12.5",
|
||||||
|
"js-base64": "^3.7.7",
|
||||||
"localforage": "^1.10.0",
|
"localforage": "^1.10.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"lunar-typescript": "^1.7.5",
|
"lunar-typescript": "^1.7.5",
|
||||||
|
|
|
@ -352,7 +352,7 @@ export default defineComponent(() => {
|
||||||
text: block.text,
|
text: block.text,
|
||||||
background: block.background,
|
background: block.background,
|
||||||
color: block.color,
|
color: block.color,
|
||||||
type: block.color ? 1 : 0
|
type: !block.icon ? 1 : 0
|
||||||
}
|
}
|
||||||
router.go('global-adder')
|
router.go('global-adder')
|
||||||
useAdderPageStore().type = 2
|
useAdderPageStore().type = 2
|
||||||
|
|
|
@ -36,7 +36,7 @@ export default defineStore('adderPage', () => {
|
||||||
const isSearch = ref(false)
|
const isSearch = ref(false)
|
||||||
const widgetSearchWords = ref('')
|
const widgetSearchWords = ref('')
|
||||||
const gameSearch = ref('')
|
const gameSearch = ref('')
|
||||||
const editBlockItem = ref<EditBlockItemType | null >(null)
|
const editBlockItem = ref<EditBlockItemType | null>(null)
|
||||||
request<HotAppCategoryType[]>('GET', '/api/app/hotAppTypes').then((res) => {
|
request<HotAppCategoryType[]>('GET', '/api/app/hotAppTypes').then((res) => {
|
||||||
categoryList.value = res.map((el) => ({
|
categoryList.value = res.map((el) => ({
|
||||||
id: el.id,
|
id: el.id,
|
||||||
|
@ -64,9 +64,10 @@ export default defineStore('adderPage', () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = (keywords: string) => {
|
const search = (keywords: string) => {
|
||||||
if (keywords === '') {
|
if (!keywords) {
|
||||||
|
if (isSearch.value) getApps(selectType.value)
|
||||||
|
|
||||||
isSearch.value = false
|
isSearch.value = false
|
||||||
getApps(selectType.value)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
isSearch.value = true
|
isSearch.value = true
|
||||||
|
|
|
@ -23,22 +23,7 @@ export default defineComponent(() => {
|
||||||
const settings = useSettingsStore()
|
const settings = useSettingsStore()
|
||||||
return () => (
|
return () => (
|
||||||
<div class="absolute left-0 top-0 w-full h-full p-4 overflow-y-auto scrollbar-hide">
|
<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="px-4">
|
||||||
<div class="h-[180px]">
|
<div class="h-[180px]">
|
||||||
{layout.background.video && layout.background.type !== 'own' ? (
|
{layout.background.video && layout.background.type !== 'own' ? (
|
||||||
|
|
|
@ -29,7 +29,7 @@ const BgContent = defineComponent({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{props.video ? (
|
{props.video ? (
|
||||||
<video src={props.video} class="w-full h-full" muted />
|
<video autoplay src={props.video} class="w-full h-full" muted />
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
class="w-full h-full bg-center bg-cover bg-no-repeat"
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val.startsWith('http')) {
|
if (val.startsWith('http')) {
|
||||||
// 内源
|
// 内源
|
||||||
if (val.startsWith(ossCdnBase)) {
|
if (val.startsWith(ossCdnBase)) {
|
||||||
// 地址后缀
|
// 地址后缀
|
||||||
|
|
||||||
const suffix = val.split('.').pop()
|
const suffix = val.split('.').pop()
|
||||||
if (!suffix) {
|
if (!suffix) {
|
||||||
return
|
return
|
||||||
|
@ -38,6 +40,7 @@ export default function useResource(tag: Ref<string>, type: string) {
|
||||||
if (videoArr.includes(suffix)) {
|
if (videoArr.includes(suffix)) {
|
||||||
// 内部视频
|
// 内部视频
|
||||||
// 先显示截图,再去数据库看是否有存货
|
// 先显示截图,再去数据库看是否有存货
|
||||||
|
|
||||||
resource.video = ''
|
resource.video = ''
|
||||||
resource.image = val + '?x-oss-process=video/snapshot,t_0,f_jpg,m_fast'
|
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'
|
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
|
if (!res) return
|
||||||
const item = res.find((item) => item.tag === val)
|
const item = res.find((item) => item.tag === val)
|
||||||
if (item) {
|
if (item) {
|
||||||
|
console.log('是是视频');
|
||||||
|
|
||||||
resource.video = URL.createObjectURL(item.file)
|
resource.video = URL.createObjectURL(item.file)
|
||||||
resource.type = 'local'
|
resource.type = 'local'
|
||||||
} else {
|
} else {
|
||||||
// 不存在,需要存入
|
// 不存在,需要存入
|
||||||
|
|
||||||
fetch(val)
|
fetch(val)
|
||||||
.then((res) => res.blob())
|
.then((res) => res.blob())
|
||||||
.then((blob) => {
|
.then((blob) => {
|
||||||
|
@ -61,6 +67,7 @@ export default function useResource(tag: Ref<string>, type: string) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 图片
|
// 图片
|
||||||
resource.image = val
|
resource.image = val
|
||||||
|
|
|
@ -115,11 +115,12 @@ export default defineComponent(() => {
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class={
|
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
|
<textarea
|
||||||
placeholder='在此输入您的问题,并可以添加图片,方便更清晰的描述问题,我们会尽快帮您解决,感谢您的反馈'
|
placeholder="在此输入您的问题,并可以添加图片,方便更清晰的描述问题,我们会尽快帮您解决,感谢您的反馈"
|
||||||
maxlength={80}
|
maxlength={80}
|
||||||
v-model={data.description}
|
v-model={data.description}
|
||||||
class="bg-transparent no-textarea w-full p-2 appearance-none resize-none placeholder:text-[14px] "
|
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} />
|
<ImageUploader width={38} v-model:value={item.value} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</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>
|
||||||
<div class="mt-4">联系方式</div>
|
<div class="mt-4">联系方式</div>
|
||||||
<div class="text-sm">留下您的联系方式,以便必要时我们可以联系到您</div>
|
<div class="text-sm">留下您的联系方式,以便必要时我们可以联系到您</div>
|
||||||
|
@ -169,13 +170,16 @@ export default defineComponent(() => {
|
||||||
await request('POST', '/api/feedback', {
|
await request('POST', '/api/feedback', {
|
||||||
data: {
|
data: {
|
||||||
content: data.description,
|
content: data.description,
|
||||||
qq: data.qq,
|
email: data.qq,
|
||||||
phone: data.phone,
|
phone: data.phone,
|
||||||
imgs: data.images
|
imgs: data.images
|
||||||
},
|
},
|
||||||
returnType: 'text'
|
returnType: 'text'
|
||||||
})
|
})
|
||||||
message.success('提交成功')
|
message.success('提交成功')
|
||||||
|
list.forEach(item=> {
|
||||||
|
item.value = ''
|
||||||
|
})
|
||||||
Object.assign(data, { ...defaultData })
|
Object.assign(data, { ...defaultData })
|
||||||
}}
|
}}
|
||||||
class="mt-4 text-center rounded py-1 cursor-pointer bg-[#ffa93d] text-white"
|
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)
|
jump(props.block.link)
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: props.block.text ? props.block.background || 'white' : 'transparent',
|
backgroundColor: !props.block.icon ? props.block.background || 'white' : 'transparent',
|
||||||
color: props.block.color || 'black',
|
color: props.block.color || 'black',
|
||||||
backgroundImage: props.block.icon ? `url('${props.block.icon}')` : '',
|
backgroundImage: props.block.icon ? `url('${props.block.icon}')` : '',
|
||||||
fontSize: props.dock ? '16px' : props.brief ? '12px' : 'calc(var(--block-size) / 5)'
|
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>
|
</div>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3,6 +3,9 @@ import { Button } from 'ant-design-vue'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import { computed, defineComponent, ref } from 'vue'
|
import { computed, defineComponent, ref } from 'vue'
|
||||||
import useLayoutStore from '../useLayoutStore'
|
import useLayoutStore from '../useLayoutStore'
|
||||||
|
import useUserStore from '@/user/useUserStore'
|
||||||
|
import useTomatoStore from '@/widgets/work/useTomatoStore'
|
||||||
|
import useNotepadStore from '@/widgets/notepad/useNotepadStore'
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
|
@ -15,49 +18,82 @@ export default defineComponent({
|
||||||
<div class="p-4 flex flex-col ">
|
<div class="p-4 flex flex-col ">
|
||||||
<SettingItem
|
<SettingItem
|
||||||
v-slots={{
|
v-slots={{
|
||||||
label: () => <div >重置</div>
|
label: () => <div>重置</div>
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button type="primary" onClick={() => {
|
<Button
|
||||||
open.value = true
|
type="primary"
|
||||||
}}>立即重置</Button>
|
onClick={() => {
|
||||||
|
open.value = true
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
立即重置
|
||||||
|
</Button>
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<p class={'text-[#666] text-[12px]'}>将会把您的历史调整清空,恢复成最初的样式</p>
|
<p class={'text-[#666] text-[12px]'}>将会把您的历史调整清空,恢复成最初的样式</p>
|
||||||
{
|
{open.value && (
|
||||||
open.value &&
|
<div
|
||||||
<div class={"w-[300px] h-[210px] absolute rounded-2xl right-[-310px] z-10 bg-[#2c2e3e]"} style={
|
class={clsx(
|
||||||
isGame.value ?
|
'w-[300px] h-[210px] absolute rounded-2xl right-[-310px] z-10 ',
|
||||||
{
|
isGame.value ? 'bg-[#2c2e3e]' : 'bg-white'
|
||||||
backgroundImage: `url('/tab/bg/addBorder.png')`,
|
)}
|
||||||
backgroundSize: '100% 100%',
|
style={
|
||||||
backgroundColor: '#2c2e3e'
|
isGame.value
|
||||||
} : {}}>
|
? {
|
||||||
|
backgroundImage: `url('/tab/bg/addBorder.png')`,
|
||||||
<div class={"flex flex-col w-full h-full p-7 border-b-[1px] items-center justify-between"}>
|
backgroundSize: '100% 100%',
|
||||||
<span class={isGame.value ? "" : ""}>恢复提醒</span>
|
backgroundColor: '#2c2e3e'
|
||||||
<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"}>
|
}
|
||||||
|
>
|
||||||
|
<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
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
layout.resetAll()
|
layout.resetAll()
|
||||||
|
useUserStore().logout()
|
||||||
|
useTomatoStore().reset()
|
||||||
|
useNotepadStore().reset()
|
||||||
open.value = false
|
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
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
open.value = false
|
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>
|
</div>
|
||||||
}
|
)}
|
||||||
|
</div>
|
||||||
</div >
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -15,12 +15,12 @@ export const DefaultPageSetting = [
|
||||||
desct: '聚合多类游戏工具,以及 资讯、排行榜等'
|
desct: '聚合多类游戏工具,以及 资讯、排行榜等'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '工作台',
|
name: '工作',
|
||||||
backgroundUrl:
|
backgroundUrl:
|
||||||
'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/b82fd47c-24c1-4f58-b0db-51414b3bdda4.webp',
|
'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/b82fd47c-24c1-4f58-b0db-51414b3bdda4.webp',
|
||||||
contentUrl:
|
contentUrl:
|
||||||
'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/7e4cf74a-85cb-4e39-9e61-385b222ac8c4.webp',
|
'https://newfatfox.oss-cn-beijing.aliyuncs.com/000/user_upload/1/resource/7e4cf74a-85cb-4e39-9e61-385b222ac8c4.webp',
|
||||||
desct: '结合番茄计时法等效率工具,让您可以高效学'
|
desct: '结合番茄计时法等效率工具,让您可以高效学习'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '轻娱',
|
name: '轻娱',
|
||||||
|
@ -57,7 +57,7 @@ export default defineComponent(() => {
|
||||||
<Transition>
|
<Transition>
|
||||||
{show.value && (
|
{show.value && (
|
||||||
<div
|
<div
|
||||||
class="w-full h-screen bg-black/60 "
|
class="w-full h-screen bg-white "
|
||||||
onClick={() => { }}
|
onClick={() => { }}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url('${DefaultPageSetting[selectMode.value].backgroundUrl}')`,
|
backgroundImage: `url('${DefaultPageSetting[selectMode.value].backgroundUrl}')`,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import debounce from 'lodash/debounce'
|
||||||
import { aIUrl, translateUrl } from '@/config'
|
import { aIUrl, translateUrl } from '@/config'
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import useStatisticStore from '@/utils/useStatisticStore'
|
import useStatisticStore from '@/utils/useStatisticStore'
|
||||||
|
import { Base64 } from "js-base64"
|
||||||
export type SearchAdType = {
|
export type SearchAdType = {
|
||||||
name: string
|
name: string
|
||||||
icon: string
|
icon: string
|
||||||
|
@ -39,15 +40,12 @@ export default defineStore('search', () => {
|
||||||
searchStr,
|
searchStr,
|
||||||
(val) => {
|
(val) => {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
fetch(
|
request<{
|
||||||
`${import.meta.env.PROD ? 'https://suggestion.baidu.com/su' : '/baiduSuggestion'}?wd=${val}&ie=utf-8&p=3&cb=j`
|
list: string[]
|
||||||
)
|
}>('GET', `/api/lookUp/${Base64.encode(val)}`,)
|
||||||
.then((res) => res.text())
|
.then(res => {
|
||||||
.then((res: string) => {
|
// const list = res.match(/(?<=s:\[").*(?=\]\})/g)?.[0]?.split('","')
|
||||||
const list = res.match(/(?<=s:\[").*(?=\]\})/g)?.[0]?.split('","')
|
sugList.value = res.list
|
||||||
if (list) {
|
|
||||||
sugList.value = list
|
|
||||||
}
|
|
||||||
}) as Promise<string[]>
|
}) as Promise<string[]>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -90,7 +90,7 @@ export default defineComponent(() => {
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<OhVueIcon name="md-stars-twotone" fill="white" scale={1.3} />
|
<OhVueIcon name="md-stars-twotone" fill="white" scale={1.3} />
|
||||||
休闲
|
轻闲
|
||||||
</div>
|
</div>
|
||||||
<svg
|
<svg
|
||||||
width="200"
|
width="200"
|
||||||
|
|
|
@ -265,17 +265,13 @@ body {
|
||||||
.background-enter-active,
|
.background-enter-active,
|
||||||
.background-leave-active {
|
.background-leave-active {
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
opacity: 1;
|
|
||||||
transition:
|
transition:
|
||||||
transform 0.6s cubic-bezier(0.47, 1.64, 0.41, 0.8),
|
transform 0.6s cubic-bezier(0.47, 1.64, 0.41, 0.8),
|
||||||
opacity 0.6s ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.background-enter-from {
|
.background-enter-from {
|
||||||
transform: scale(1.25);
|
transform: scale(1.2);
|
||||||
opacity: 0;
|
|
||||||
}
|
}
|
||||||
.background-leave-to {
|
.background-leave-to {
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
opacity: 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,6 @@ export default defineStore('statistic', () => {
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|
||||||
list.value = []
|
list.value = []
|
||||||
message.success('发送统计成功')
|
|
||||||
})
|
})
|
||||||
}, 2500) //
|
}, 2500) //
|
||||||
watch(list, (newValue) => {
|
watch(list, (newValue) => {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from 'pinia'
|
||||||
import { reactive } from "vue";
|
import { reactive } from 'vue'
|
||||||
import { v4 as uuid } from "uuid"
|
import { v4 as uuid } from 'uuid'
|
||||||
import dayjs from "dayjs";
|
import dayjs from 'dayjs'
|
||||||
export const DEFALUT_DATA = {
|
export const DEFALUT_DATA = {
|
||||||
content: `
|
content: `
|
||||||
欢迎来到FatfoxTab新标签页平台!在这里您将发现海量有趣的内容和实用的工具。
|
欢迎来到FatfoxTab新标签页平台!在这里您将发现海量有趣的内容和实用的工具。
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,34 +104,43 @@ FatfoxTab新标签页共分为四个模式;
|
||||||
更多新功能正在加速开发中,敬请期待...
|
更多新功能正在加速开发中,敬请期待...
|
||||||
|
|
||||||
`,
|
`,
|
||||||
title: "FatFoxTab指南",
|
title: 'FatFoxTab指南',
|
||||||
date: 1730877843004,
|
date: 1730877843004,
|
||||||
id: "defautId"
|
id: 'defautId',
|
||||||
};
|
pin: false
|
||||||
export type NotepadItem = {
|
|
||||||
title: string
|
|
||||||
content: string
|
|
||||||
id: string
|
|
||||||
date: number
|
|
||||||
pin: boolean
|
|
||||||
}
|
}
|
||||||
export default defineStore("notepad", () => {
|
export type NotepadItem = {
|
||||||
|
title: string
|
||||||
|
content: string
|
||||||
|
id: string
|
||||||
|
date: number
|
||||||
|
pin: boolean
|
||||||
|
}
|
||||||
|
export default defineStore(
|
||||||
|
'notepad',
|
||||||
|
() => {
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
list: [DEFALUT_DATA] as NotepadItem[]
|
list: [DEFALUT_DATA] as NotepadItem[]
|
||||||
})
|
})
|
||||||
const addNewNote = () => {
|
const addNewNote = () => {
|
||||||
state.list.unshift({
|
state.list.unshift({
|
||||||
id: uuid(),
|
id: uuid(),
|
||||||
title: '',
|
title: '',
|
||||||
date: dayjs().valueOf(),
|
date: dayjs().valueOf(),
|
||||||
content: '',
|
content: '',
|
||||||
pin: false
|
pin: false
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
const reset = () => {
|
||||||
|
state.list = [DEFALUT_DATA]
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
addNewNote
|
addNewNote,
|
||||||
|
reset
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
persist: true
|
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'
|
'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>
|
</div>
|
||||||
<span class={'text-[42px] mb-1'}>
|
<span class={'text-[42px] mb-1'}>
|
||||||
{store.state.beginTime < 0 ? '15:00' : formatSeconds(store.remainingTime)}
|
{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'
|
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", () => {
|
export default defineStore("work", () => {
|
||||||
const state = reactive({
|
const state = reactive({ ...initData })
|
||||||
list: [] as TomatoTarget[],
|
|
||||||
timeList: [] as number[],
|
|
||||||
isPlaying: false as boolean,
|
|
||||||
selectMusic: 0,
|
|
||||||
isStart: false as boolean,
|
|
||||||
beginTime: -1 as number,
|
|
||||||
})
|
|
||||||
const audio = new Audio()
|
const audio = new Audio()
|
||||||
const time = useTimeStore()
|
const time = useTimeStore()
|
||||||
const remainingTime = computed(() => {
|
const remainingTime = computed(() => {
|
||||||
|
@ -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
|
return state.list.filter(val => dayjs(val.finishTime).isSame(dayjs().subtract(1, 'day'), 'day') && val.isCompleted).length
|
||||||
|
|
||||||
})
|
})
|
||||||
|
const reset = () => {
|
||||||
|
Object.assign(state, { ...initData })
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
openShowModel,
|
openShowModel,
|
||||||
|
@ -131,7 +134,8 @@ export default defineStore("work", () => {
|
||||||
yestodayHour,
|
yestodayHour,
|
||||||
todayFinishTarget,
|
todayFinishTarget,
|
||||||
yesFinishTarget,
|
yesFinishTarget,
|
||||||
setTrack
|
setTrack,
|
||||||
|
reset
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
persist: true
|
persist: true
|
||||||
|
|
Loading…
Reference in New Issue