|
@@ -1,25 +1,55 @@
|
|
|
<template>
|
|
<template>
|
|
|
<router-view />
|
|
<router-view />
|
|
|
<Notify v-model:show="notify.show" :title="notify.title" :content="notify.content" />
|
|
<Notify v-model:show="notify.show" :title="notify.title" :content="notify.content" />
|
|
|
|
|
+ <Dialog class="g-dialog-tips" v-model:show="tips.show" :title="currentTipts?.title" theme="round-button" confirm-button-text="关闭">
|
|
|
|
|
+ <div class="g-dialog-tips__content" v-html="currentTipts?.content"></div>
|
|
|
|
|
+ <div class="g-dialog-tips__footer">
|
|
|
|
|
+ <span :class="{ disabled: tips.index === 0 }" @click="changeTips(-1)">上一条</span>
|
|
|
|
|
+ <span :class="{ disabled: tips.index === (noticeStore.tipsList.length - 1) }" @click="changeTips(1)">下一条</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { reactive } from 'vue'
|
|
|
|
|
|
|
+import { reactive, watch, computed } from 'vue'
|
|
|
|
|
+import { Dialog } from 'vant'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { dialog } from '@/utils/vant'
|
|
import { dialog } from '@/utils/vant'
|
|
|
import { useLogin } from '@/business/login'
|
|
import { useLogin } from '@/business/login'
|
|
|
|
|
+import { useNoticeStore } from '@/stores'
|
|
|
import eventBus from '@/services/bus'
|
|
import eventBus from '@/services/bus'
|
|
|
import Notify from '@mobile/components/base/notify/index.vue'
|
|
import Notify from '@mobile/components/base/notify/index.vue'
|
|
|
|
|
|
|
|
const { userLogout } = useLogin()
|
|
const { userLogout } = useLogin()
|
|
|
const { backHome } = useNavigation()
|
|
const { backHome } = useNavigation()
|
|
|
|
|
+const noticeStore = useNoticeStore()
|
|
|
|
|
|
|
|
|
|
+// 当前提示信息
|
|
|
|
|
+const currentTipts = computed(() => noticeStore.noticeList[tips.index])
|
|
|
|
|
+
|
|
|
|
|
+// 通知
|
|
|
const notify = reactive({
|
|
const notify = reactive({
|
|
|
show: false,
|
|
show: false,
|
|
|
title: '',
|
|
title: '',
|
|
|
content: ''
|
|
content: ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+// 提示
|
|
|
|
|
+const tips = reactive({
|
|
|
|
|
+ show: false,
|
|
|
|
|
+ index: 0
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+// 切换提示
|
|
|
|
|
+const changeTips = (value: number) => {
|
|
|
|
|
+ const i = tips.index + value
|
|
|
|
|
+ if (i > -1 && i < noticeStore.tipsList.length) {
|
|
|
|
|
+ tips.index = i
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+watch(() => noticeStore.tipsList.length, (val) => tips.show = !!val)
|
|
|
|
|
+
|
|
|
// 接收用户登出通知
|
|
// 接收用户登出通知
|
|
|
eventBus.$on('LogoutNotify', (msg) => {
|
|
eventBus.$on('LogoutNotify', (msg) => {
|
|
|
userLogout(() => {
|
|
userLogout(() => {
|