15 changed files with 150 additions and 28 deletions
@ -0,0 +1,11 @@ |
|||||
|
# Changelog |
||||
|
|
||||
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. |
||||
|
|
||||
|
## 1.0.0-B.1 (2023-10-25) |
||||
|
|
||||
|
|
||||
|
### Features |
||||
|
|
||||
|
* 🚀 commit ([e31a067](https://git.1000my.com/project_yongwangyun/YongWang_Customer/commit/e31a067acf66fdbc0d41e9ec04905b066ee3325d)) |
||||
|
* 🚀 first commit ([26b3c78](https://git.1000my.com/project_yongwangyun/YongWang_Customer/commit/26b3c78b13b9e7b083bd918a77aceba1fc257355)) |
||||
@ -0,0 +1,33 @@ |
|||||
|
import { ref } from 'vue' |
||||
|
|
||||
|
export const useAutoBack = (callback: () => void) => { |
||||
|
const MIN_TIME = 0 |
||||
|
const CHECK_TIME = 1000 |
||||
|
const TO_INDEX_TIME = 10 |
||||
|
const toIndexTime = ref(TO_INDEX_TIME) //回首页的时间
|
||||
|
|
||||
|
const toIndexInterval = ref() |
||||
|
|
||||
|
function sleepToIndex() { |
||||
|
return new Promise<void>(resolve => { |
||||
|
toIndexInterval.value = setInterval(() => { |
||||
|
toIndexTime.value-- |
||||
|
if (toIndexTime.value <= MIN_TIME) { |
||||
|
clearInterval(toIndexInterval.value) |
||||
|
resolve() |
||||
|
} |
||||
|
}, CHECK_TIME) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
async function checkHandleScreen() { |
||||
|
toIndexTime.value = TO_INDEX_TIME |
||||
|
clearInterval(toIndexInterval.value) |
||||
|
await sleepToIndex() |
||||
|
callback() |
||||
|
} |
||||
|
|
||||
|
return { |
||||
|
checkHandleScreen |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,13 @@ |
|||||
interface Customer { |
interface Customer { |
||||
suggestionContent: string |
suggestionContent: string |
||||
replyContent: string |
replyContent: string |
||||
|
fileList: { |
||||
|
extCode: string |
||||
|
fileCode: string |
||||
|
fileName: string |
||||
|
filePath: string |
||||
|
type: string |
||||
|
}[] |
||||
addTime: string |
addTime: string |
||||
updateTime: string |
updateTime: string |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue