lifanagju_citu 9 mēneši atpakaļ
vecāks
revīzija
4ac59f594a

+ 3 - 0
src/plugins/snackbar/index.js

@@ -28,6 +28,9 @@ toastMessage.info = (message, variant, timeout) => {
 toastMessage.warning = (message, variant, timeout) => {
   toastMessage({ message, color: 'warning', variant, timeout })
 }
+toastMessage.point = (message, variant, timeout) => {
+  toastMessage({ message, color: 'point', variant, timeout })
+}
 // 注册插件app.use()会自动执行install函数
 toastMessage.install = (app) => {
   app.config.globalProperties.Snackbar = toastMessage

+ 18 - 0
src/plugins/snackbar/message.vue

@@ -1,6 +1,24 @@
 <template>
   <v-app :full-height="false">
     <v-snackbar
+      v-if="color === 'point'"
+      style="padding-top: 40vh;"
+      timeout="-1"
+      location="top"
+      color="#f9eddce3"
+      :variant="variant || 'flat'"
+      v-model="snackbar"
+    >
+    <div class="d-flex align-end">
+      <span style="color: darkorange; font-size: 48px;" class="mdi mdi-database-check-outline ml-5 mr-2"></span>
+      <div style="color: darkorange;" class="mb-3">{{message}}</div>
+    </div>
+    <template v-slot:actions>
+          <span style="color: darkorange; font-size: 22px;" class="mdi mdi-close-circle-outline mr-5" @click="snackbar = false"></span>
+        </template>
+    </v-snackbar>
+    <v-snackbar
+      v-else
       timeout="-1"
       location="top"
       :variant="variant || 'flat'"

+ 1 - 1
src/utils/prefixUrl.js

@@ -22,7 +22,7 @@ export function showNextAction (list, currentIndex = 0) {
   if (currentIndex < list.length) {
     const action = list[currentIndex]
     if (action.match) {
-      Snackbar.success(`恭喜您${action.title}获得${action.point}积分`)
+      Snackbar.point(`恭喜您${action.title}获得${action.point}积分`)
       setTimeout(() => {
         showNextAction(list, currentIndex + 1)
       }, 3000)