|
@@ -1,29 +1,17 @@
|
|
|
<template>
|
|
|
- <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
|
|
|
- <u-tabs :list="tabsList" :current="tabsCurrent" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }" :scrollable="true"></u-tabs>
|
|
|
- </u-sticky>
|
|
|
-
|
|
|
<scroll-view class="scroll-height" :scroll-y="true" :scroll-into-view="scrollIntoView" :data-theme="'theme-' + proxy.$settingStore.themeColor.name" style="padding-bottom: 44px">
|
|
|
<view class="appMessage-container">
|
|
|
- <view class="content-area" v-show="tabsCurrent == 0">
|
|
|
- <u-empty v-show="allInfoList.length <= 0" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
|
|
|
- <view :id="index == allInfoList.length - 1 ? 'bottomInfo' : ''" v-for="(all, index) in allInfoList" :key="index" v-show="allInfoList.length > 0" @click="goContentDetails(all)">
|
|
|
- <view class="content-area-time font12">{{ all.listTime }}</view>
|
|
|
- <view class="content-area-center radius bg-white">
|
|
|
- <view class="content-area-center-title">{{ all.typeTitle }}</view>
|
|
|
- <view class="content-area-center-cont">{{ all.listTitle }}</view>
|
|
|
- <view class="content-area-center-buttom font12">查看详情 </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="content-area" v-show="tabsCurrent == 1">
|
|
|
- <u-empty v-show="noticeList.length <= 0" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
|
|
|
+ <view class="content-area">
|
|
|
+ <u-empty v-if="noticeList.length <= 0 && loading" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
|
|
|
<view :id="index == noticeList.length - 1 ? 'bottomInfo' : ''" v-for="(all, index) in noticeList" :key="index" v-show="noticeList.length > 0" @click="goContentDetails(all)">
|
|
|
- <view class="content-area-time font12">{{ all.listTime }}</view>
|
|
|
- <view class="content-area-center radius bg-white">
|
|
|
- <view class="content-area-center-title">{{ all.typeTitle }}</view>
|
|
|
- <view class="content-area-center-cont">{{ all.listTitle }}</view>
|
|
|
- <view class="content-area-center-buttom font12">查看详情 </view>
|
|
|
+
|
|
|
+ <view class="content-area-center radius bg-white list-cell2 list-cell-arrow2">
|
|
|
+ <view class="">
|
|
|
+ <image class="content-area-center-image-bg" :src="all.img" />
|
|
|
+ <view class="content-area-center-title font16">{{ all.infoTitle }}</view>
|
|
|
+ <view class="content-area-center-time font14 ">{{ all.createTime.substring(5,10) }} {{ all.createTime.substring(11,16) }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="content-area-center-cont font14">{{ all.infoContent }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -34,31 +22,22 @@
|
|
|
<script setup>
|
|
|
import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
|
|
|
import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
|
|
|
-import { useStores, commonStores } from "@/store/modules/index";
|
|
|
-
|
|
|
-import { infoList } from "@/api/common/message.js";
|
|
|
-
|
|
|
+import { useStores, commonStores,stystemStores } from "@/store/modules/index";
|
|
|
+import { getMceList } from "@/api/mine/info.js";
|
|
|
const useStore = useStores();
|
|
|
+const stystemStore = stystemStores();
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
-
|
|
|
+const infoType = ref()//消息类型
|
|
|
+const loading =ref(false)
|
|
|
const data = reactive({
|
|
|
scrollIntoView: "",
|
|
|
-
|
|
|
- tabsList: [
|
|
|
- {
|
|
|
- name: "全部",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "通知公告",
|
|
|
- },
|
|
|
- ],
|
|
|
tabsCurrent: 0,
|
|
|
|
|
|
allInfoList: [],
|
|
|
noticeList: [],
|
|
|
});
|
|
|
|
|
|
-const { scrollIntoView, scrollIntoViewBool, tabsList, tabsCurrent, allInfoList, noticeList } = toRefs(data);
|
|
|
+const { scrollIntoView, scrollIntoViewBool, tabsCurrent, allInfoList, noticeList } = toRefs(data);
|
|
|
|
|
|
/**
|
|
|
* @初始化
|
|
@@ -78,9 +57,7 @@ function tabsClick(e) {
|
|
|
* @跳转
|
|
|
*/
|
|
|
function goContentDetails(e) {
|
|
|
- if (e.type == "通知公告") {
|
|
|
- proxy.$tab.navigateTo(`/pages/common/textview/index1?title=${e.typeTitle}&content=${e.listContent}&contentTitle=${e.listTitle}`);
|
|
|
- }
|
|
|
+ proxy.$tab.navigateTo(`/pages/common/textview/index?id=${e.id}`);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -89,31 +66,23 @@ function goContentDetails(e) {
|
|
|
*/
|
|
|
function infoListApi() {
|
|
|
proxy.$modal.loading("加载中");
|
|
|
- infoList({
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 20000,
|
|
|
+ getMceList({
|
|
|
+ current: 1,
|
|
|
+ size: 10,
|
|
|
+ infoType: infoType.value
|
|
|
}).then((requset) => {
|
|
|
+ let data = requset.data.records
|
|
|
+ let infoTypeList = stystemStore.infoList.static.infoTypeStatic
|
|
|
if (requset.status === "SUCCESS") {
|
|
|
- requset.data.rows.forEach((el) => {
|
|
|
- allInfoList.value.push({
|
|
|
- type: "通知公告",
|
|
|
- typeTitle: el.noticeType === "1" ? "系统通知" : el.noticeType === "2" ? "系统公告" : "系统消息",
|
|
|
- listTime: proxy.$common.jktTimes(el.createTime),
|
|
|
- listCreateTime: el.createTime,
|
|
|
- listTitle: el.noticeTitle,
|
|
|
- listContent: el.noticeContent,
|
|
|
- });
|
|
|
-
|
|
|
- noticeList.value.push({
|
|
|
- type: "通知公告",
|
|
|
- typeTitle: el.noticeType === "1" ? "系统通知" : el.noticeType === "2" ? "系统公告" : "系统消息",
|
|
|
- listTime: proxy.$common.jktTimes(el.createTime),
|
|
|
- listCreateTime: proxy.$common.jktTimes(el.createTime),
|
|
|
- listTitle: el.noticeTitle,
|
|
|
- listContent: el.noticeContent,
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ for (let j = 0; j < infoTypeList.length; j++) {
|
|
|
+ if(data[i].infoType == infoTypeList[j].infoType){
|
|
|
+ data[i].img = infoTypeList[j].img
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ noticeList.value = data
|
|
|
+ loading.value = true
|
|
|
setTimeout(() => {
|
|
|
scrollIntoView.value = "bottomInfo";
|
|
|
}, 0);
|
|
@@ -122,10 +91,18 @@ function infoListApi() {
|
|
|
proxy.$modal.closeLoading();
|
|
|
}, 100);
|
|
|
}
|
|
|
+ setTimeout(() => {
|
|
|
+ scrollIntoView.value = "bottomInfo";
|
|
|
+ }, 0);
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ proxy.$modal.closeLoading();
|
|
|
+ }, 100);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
onLoad((options) => {
|
|
|
+ infoType.value = options.type
|
|
|
init();
|
|
|
});
|
|
|
|
|
@@ -153,30 +130,40 @@ onNavigationBarButtonTap((e) => {
|
|
|
padding-bottom: 1px;
|
|
|
|
|
|
.content-area {
|
|
|
- &-time {
|
|
|
- padding: 10px 0;
|
|
|
- text-align: center;
|
|
|
- color: #909399;
|
|
|
- }
|
|
|
-
|
|
|
&-center {
|
|
|
margin: 0 10px 20px 10px;
|
|
|
padding: 15px;
|
|
|
overflow: hidden;
|
|
|
-
|
|
|
+ position: relative;
|
|
|
+ &-image-bg {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
&-title {
|
|
|
- margin: 0 0 15px 0;
|
|
|
+ margin-left: 15px;
|
|
|
+ color: #000;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ white-space: nowrap; /* 确保文本在一行内显示 */
|
|
|
+ overflow: hidden; /* 隐藏超出容器的内容 */
|
|
|
+ text-overflow: ellipsis; /* 使用省略号表示被截断的文本 */
|
|
|
+ width: 60%; /* 定义容器宽度 */
|
|
|
+ }
|
|
|
+ &-time {
|
|
|
color: #909399;
|
|
|
+ float:right;
|
|
|
+ margin-right:4px;
|
|
|
+ margin-top:12px
|
|
|
}
|
|
|
-
|
|
|
&-cont {
|
|
|
- font-weight: 600;
|
|
|
- color: #000000;
|
|
|
- }
|
|
|
-
|
|
|
- &-buttom {
|
|
|
- float: right;
|
|
|
- color: #2a98ff;
|
|
|
+ color: #ccc;
|
|
|
+ margin-top:16px;
|
|
|
+ white-space: nowrap; /* 确保文本在一行内显示 */
|
|
|
+ overflow: hidden; /* 隐藏超出容器的内容 */
|
|
|
+ text-overflow: ellipsis; /* 使用省略号表示被截断的文本 */
|
|
|
+ width: 100%; /* 定义容器宽度 */
|
|
|
}
|
|
|
}
|
|
|
}
|