li.shaoyi 10 달 전
부모
커밋
96bb2d88f0

+ 31 - 1
src/packages/sbyj/App.vue

@@ -1,25 +1,55 @@
 <template>
   <router-view />
   <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>
 
 <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 { dialog } from '@/utils/vant'
 import { useLogin } from '@/business/login'
+import { useNoticeStore } from '@/stores'
 import eventBus from '@/services/bus'
 import Notify from '@mobile/components/base/notify/index.vue'
 
 const { userLogout } = useLogin()
 const { backHome } = useNavigation()
+const noticeStore = useNoticeStore()
 
+// 当前提示信息
+const currentTipts = computed(() => noticeStore.noticeList[tips.index])
+
+// 通知
 const notify = reactive({
   show: false,
   title: '',
   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) => {
   userLogout(() => {

+ 1 - 1
src/packages/sbyj/views/market/list/index.vue

@@ -109,7 +109,7 @@ useRequest(queryImageConfigs, {
     }
 })
 
-// 构建游客交易商品
+// 构建游客交易商品 任务 #6614
 const touristTradeGoodsList = computed(() => {
     const list = futuresStore.getGoodsListByTradeMode(52)
     const result = list.sort((a, b) => a.goodsorder.localeCompare(b.goodsorder))

+ 25 - 0
src/packages/sjgj/assets/themes/global/global.less

@@ -450,6 +450,31 @@
     }
 }
 
+.g-dialog-tips {
+    &__content {
+        max-height: 50vh;
+        overflow-y: auto;
+        line-height: 1.5;
+        padding: 15px;
+    }
+
+    &__footer {
+        display: flex;
+        justify-content: center;
+        padding: 10px;
+
+        span {
+            &:not(:first-child) {
+                margin-left: 10px;
+            }
+
+            &.disabled {
+                color: #999;
+            }
+        }
+    }
+}
+
 .van {
     &-dialog {
         &__message {

+ 6 - 7
src/packages/sjgj/views/home/main/index.vue

@@ -54,15 +54,14 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from "vue";
-import { Cell, CellGroup, PullRefresh, Badge } from "vant";
-import { formatDate } from "@/filters";
-import { useNavigation } from '@mobile/router/navigation';
-import { queryImageConfigs } from "@/services/api/common";
+import { shallowRef } from 'vue'
+import { Cell, CellGroup, PullRefresh, Badge } from 'vant'
+import { formatDate } from '@/filters'
+import { useNavigation } from '@mobile/router/navigation'
+import { queryImageConfigs } from '@/services/api/common'
 import { useNoticeStore, useGlobalStore } from '@/stores'
 import Banner from '@mobile/components/base/banner/index.vue'
-import Iconfont from '@/components/base/iconfont/index.vue'
-import { queryNewTitles } from "@/services/api/news";
+import { queryNewTitles } from '@/services/api/news'
 
 const { routerTo } = useNavigation()
 const noticeStore = useNoticeStore()

+ 6 - 0
src/stores/modules/notice.ts

@@ -18,6 +18,11 @@ export const useNoticeStore = defineStore(() => {
         return state.noticeList.filter((e) => !e.readed)
     })
 
+    // 强制显示列表
+    const tipsList = computed(() => {
+        return state.noticeList.filter((e) => e.isforcedisplay)
+    })
+
     // 获取通知列表
     const getNoticeList = async () => {
         try {
@@ -62,6 +67,7 @@ export const useNoticeStore = defineStore(() => {
     return {
         ...toRefs(state),
         unreadList,
+        tipsList,
         getNoticeList,
         updateNoticeReaded,
     }

+ 1 - 0
src/types/model/common.d.ts

@@ -305,6 +305,7 @@ declare global {
             createtime: string; // 创建时间
             creatorid: number; // 建仓人
             endtime: string; // 结束时间
+            isforcedisplay: number; // 是否强制显示 - 0:不强制 1:强制
             istop: number; // 是否置顶 - 0:不置顶 1:置顶
             msgiconurl: string; // 消息图标Url
             msgtype: number; // 消息类型 - 1:公告通知 2:系统消息 3:商品到期提货通知