소스 검색

[edit][全局提示]

zhangwei 2 년 전
부모
커밋
1a34cdc7ea
5개의 변경된 파일75개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/assets/svg/icon-global-tip.svg
  2. 8 0
      src/http/messageApi.js
  3. 58 0
      src/view/components/global-tip.vue
  4. 3 0
      src/view/iframe/red-packet/red-packet.vue
  5. 2 0
      src/view/popup/popup.vue

+ 4 - 0
src/assets/svg/icon-global-tip.svg

@@ -0,0 +1,4 @@
+<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
+<circle cx="7.5" cy="7.5" r="7.5" fill="#DCA550"/>
+<path d="M6.76318 8.39551H8.1167L8.24561 3.25H6.63428L6.76318 8.39551ZM7.43994 11.0649C7.92871 11.0649 8.31543 10.6943 8.31543 10.2217C8.31543 9.74902 7.92871 9.37842 7.43994 9.37842C6.95117 9.37842 6.56445 9.74902 6.56445 10.2217C6.56445 10.6943 6.95117 11.0649 7.43994 11.0649Z" fill="#262626"/>
+</svg>

+ 8 - 0
src/http/messageApi.js

@@ -16,3 +16,11 @@ export function getAllMessageInfo(params) {
     })
 }
 
+
+export function getAppNotification(params) {
+    return service({
+        url: `/base/config/getAppNotification`,
+        method: 'post',
+        data: params
+    })
+}

+ 58 - 0
src/view/components/global-tip.vue

@@ -0,0 +1,58 @@
+<template>
+    <div class="global-tip" v-if="state.is_show == 1">
+        <img :src="require('@/assets/svg/icon-global-tip.svg')" alt="">
+        <p>{{ state.msg }}</p>
+    </div>
+</template>
+<script setup>
+import { onMounted, reactive, defineProps } from "vue";
+import { getAppNotification } from '@/http/messageApi.js'
+let props = defineProps({
+    type: String,
+})
+// 显示位置:1-红包主体,2-发布器,3-插件主体
+
+let state = reactive({
+
+})
+
+onMounted(() => {
+    getAppNotification().then((res) => {
+        if (res.code == 0) {
+            res.data.forEach((item) => {
+                if (props.type == item.type) {
+                    state.is_show = item.isShow
+                    state.msg = item.message
+                }
+            })
+        }
+    })
+})
+
+</script>
+<style lang="scss" scoped>
+.global-tip {
+    position: absolute;
+    z-index: 999;
+    display: flex;
+    height: 40px;
+    background: #000000;
+    opacity: 0.7;
+    align-items: center;
+    width: 100%;
+
+    img {
+        width: 15px;
+        height: 15px;
+        margin-left: 17px;
+        margin-right: 10px;
+    }
+
+    p {
+        color: #DCA550;
+        flex: 1;
+        margin: 0;
+        padding: 0;
+    }
+}
+</style>

+ 3 - 0
src/view/iframe/red-packet/red-packet.vue

@@ -1,6 +1,8 @@
 <!-- 红包任务页面 -->
 <template>
   <div class="content">
+    <!-- global-tip -->
+    <global-tip :type="'1'"></global-tip>
     <!-- open -->
     <div v-show="state.status == 'opened'" class="opened">
       <!-- <div class="header" :style="{ 'backgroundImage': `url(${require('@/assets/subject/001-back-head-top.svg')})` }">
@@ -348,6 +350,7 @@ import Report from "@/log-center/log"
 import { srcPublishSuccess } from '@/http/publishApi'
 import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
 import { discordAuthRedirectUri } from '@/http/configAPI'
+import  GlobalTip  from '@/view/components/global-tip.vue'
 
 var moment = require('moment');
 

+ 2 - 0
src/view/popup/popup.vue

@@ -1,4 +1,5 @@
 <template>
+    <global-tip :type="'3'"></global-tip>
     <div class="page-wrapper" ref="pageWrapperDom" @scroll="pageScroll">
         <template v-if="isLogin && homeVisibility">
             <v-head :show_more="true" :show_state="'home'" :user_info="userInfo"></v-head>
@@ -233,6 +234,7 @@ import { setBadgeInfo, hideBadge } from "@/logic/background/twitter";
 import Report from "@/log-center/log";
 import router from "@/router/popup.js";
 import { getBit } from "@/uilts/help";
+import  GlobalTip  from '@/view/components/global-tip.vue'
 
 import VHead from '@/view/popup/components/head.vue';