|
@@ -2,7 +2,7 @@
|
|
|
<scroll-view class="scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name" style="padding-bottom: 64px">
|
|
|
<view class="appMessage-container">
|
|
|
<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>
|
|
|
+ <u-empty v-if="noticeList.length <= 0 && state.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-center radius bg-white list-cell list-cell-arrow">
|
|
|
<view class="">
|
|
@@ -21,23 +21,31 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+/*----------------------------------依赖引入-----------------------------------*/
|
|
|
import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
|
|
|
import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
|
|
|
+/*----------------------------------接口引入-----------------------------------*/
|
|
|
import { getMceList, updateMceReceiveStatus } from "@/api/mine/info.js";
|
|
|
+/*----------------------------------组件引入-----------------------------------*/
|
|
|
+/*----------------------------------store引入-----------------------------------*/
|
|
|
+/*----------------------------------公共方法引入-----------------------------------*/
|
|
|
import { storageSystem } from "@/utils/storage";
|
|
|
+/*----------------------------------公共变量-----------------------------------*/
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
-const infoType = ref(); //消息类型
|
|
|
-const loading = ref(false);
|
|
|
-const data = reactive({
|
|
|
+const { message_type } = proxy.useDict("message_type");
|
|
|
+/*----------------------------------变量声明-----------------------------------*/
|
|
|
+const state = reactive({
|
|
|
+ loading: false,
|
|
|
+ infoType: undefined, //消息类型
|
|
|
+
|
|
|
scrollIntoView: "",
|
|
|
tabsCurrent: 0,
|
|
|
|
|
|
allInfoList: [],
|
|
|
noticeList: [],
|
|
|
- pageTitle: undefined,
|
|
|
});
|
|
|
|
|
|
-const { scrollIntoView, tabsCurrent, noticeList, pageTitle } = toRefs(data);
|
|
|
+const { scrollIntoView, tabsCurrent, noticeList } = toRefs(state);
|
|
|
|
|
|
/**
|
|
|
* @tabs点击事件
|
|
@@ -50,15 +58,14 @@ function tabsClick(e) {
|
|
|
* @跳转相应类型系统
|
|
|
*/
|
|
|
function goContentDetails(e) {
|
|
|
- console.log(e);
|
|
|
if (e.infoType == 4) {
|
|
|
- proxy.$tab.navigateTo(`/pages/business/fireIot/alarmManage/alarmDetails/index?id=${e.id}`).then(() => {
|
|
|
+ proxy.$tab.navigateTo(`/pages/business/fireIot/alarmManage/alarmDetails/index?contentId=${e.contentId}`).then(() => {
|
|
|
if (!e.readFlag) {
|
|
|
updateMceReceiveStatus({ id: e.id });
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- proxy.$tab.navigateTo(`/pages/common/appMessage/details?id=${e.id}`).then(() => {
|
|
|
+ proxy.$tab.navigateTo(`/pages/common/appMessage/details?contentId=${e.contentId}`).then(() => {
|
|
|
if (!e.readFlag) {
|
|
|
updateMceReceiveStatus({ id: e.id });
|
|
|
}
|
|
@@ -72,30 +79,18 @@ function goContentDetails(e) {
|
|
|
*/
|
|
|
function infoListApi(options) {
|
|
|
proxy.$modal.loading("加载中");
|
|
|
- let infoTypeList = storageSystem.get("infoList")?.infoTypeStatic;
|
|
|
- for (let i = 0; i < infoTypeList.length; i++) {
|
|
|
- if (infoType.value == infoTypeList[i].infoType) {
|
|
|
- pageTitle.value = infoTypeList[i].label;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
uni.setNavigationBarTitle({
|
|
|
- title: pageTitle.value,
|
|
|
+ title: options?.typeName ? options?.typeName : "消息列表",
|
|
|
});
|
|
|
+
|
|
|
getMceList({
|
|
|
- infoType: infoType.value,
|
|
|
+ infoType: options?.type,
|
|
|
}).then((requset) => {
|
|
|
let data = requset.data.records;
|
|
|
if (requset.status === "SUCCESS") {
|
|
|
- noticeList.value = data;
|
|
|
- loading.value = true;
|
|
|
- setTimeout(() => {
|
|
|
- scrollIntoView.value = "bottomInfo";
|
|
|
- }, 0);
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- proxy.$modal.closeLoading();
|
|
|
- }, 100);
|
|
|
+ state.noticeList = data;
|
|
|
+ state.loading = true;
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
scrollIntoView.value = "bottomInfo";
|
|
@@ -106,7 +101,7 @@ function infoListApi(options) {
|
|
|
}, 100);
|
|
|
|
|
|
if ("id" in options) {
|
|
|
- noticeList.value.forEach((e) => {
|
|
|
+ state.noticeList.forEach((e) => {
|
|
|
if (e.id == options.id) {
|
|
|
goContentDetails(e);
|
|
|
}
|
|
@@ -116,15 +111,12 @@ function infoListApi(options) {
|
|
|
}
|
|
|
|
|
|
onLoad((options) => {
|
|
|
- infoType.value = options.type;
|
|
|
-
|
|
|
infoListApi(options);
|
|
|
});
|
|
|
|
|
|
onReady(() => {});
|
|
|
|
|
|
onShow(() => {
|
|
|
- infoListApi({});
|
|
|
//调用系统主题颜色
|
|
|
proxy.$settingStore.systemThemeColor([1]);
|
|
|
});
|