|
@@ -1,4 +1,6 @@
|
|
-import Snackbar from '@/plugins/snackbar'
|
|
|
|
|
|
+// import Snackbar from '@/plugins/snackbar'
|
|
|
|
+import Curtain from '@/plugins/curtain'
|
|
|
|
+
|
|
|
|
|
|
const prefixList = ['/app-api', '/admin-api']
|
|
const prefixList = ['/app-api', '/admin-api']
|
|
export const getSuffixAfterPrefix = (str) => {
|
|
export const getSuffixAfterPrefix = (str) => {
|
|
@@ -18,18 +20,23 @@ export const getSuffixAfterPrefix = (str) => {
|
|
|
|
|
|
|
|
|
|
// 展示积分
|
|
// 展示积分
|
|
-export function showNextAction (list, currentIndex = 0) {
|
|
|
|
- if (currentIndex < list.length) {
|
|
|
|
- const action = list[currentIndex]
|
|
|
|
- if (action.match) {
|
|
|
|
- Snackbar.point(`恭喜您${action.title}获得${action.point}积分`)
|
|
|
|
- setTimeout(() => {
|
|
|
|
- showNextAction(list, currentIndex + 1)
|
|
|
|
- }, 3000)
|
|
|
|
- } else {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- showNextAction(list, currentIndex + 1)
|
|
|
|
- }, 0)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+export function showNextAction (list) { // , currentIndex = 0
|
|
|
|
+ const arr = list.reduce((newArr, action) => {
|
|
|
|
+ if (action.match) newArr.push(`+${action.point} 恭喜您【${action.title}】获得${action.point}积分`)
|
|
|
|
+ return newArr
|
|
|
|
+ }, [])
|
|
|
|
+ if (arr?.length) Curtain('point', { list: arr })
|
|
|
|
+ // if (currentIndex < list.length) {
|
|
|
|
+ // const action = list[currentIndex]
|
|
|
|
+ // if (action.match) {
|
|
|
|
+ // Snackbar.point(`+${action.point} 恭喜您${action.title}获得${action.point}积分`)
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // showNextAction(list, currentIndex + 1)
|
|
|
|
+ // }, 3000)
|
|
|
|
+ // } else {
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // showNextAction(list, currentIndex + 1)
|
|
|
|
+ // }, 0)
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}
|
|
}
|