Explorar el Código

Merge branch 'tj-user' into test

zqwang hace 1 año
padre
commit
df7c8459e8

+ 22 - 4
src/views/notice/mynotice/dataStatistics/notices.vue

@@ -2,10 +2,13 @@
 	<div class="noticebody">
 		<div class="notice-item" @click="titleClick(item)"  v-for="(item,index) in list" :key="index" >
 		 <el-badge v-if="item.is_read == 0" is-dot class="item">
-		    <el-image class="logo" src="./src/assets/notice.png"></el-image>
+		    <img class="logo" src="@/assets/notice.png" />
 		  </el-badge>
-			   <el-image class="logo"  v-else   src="./src/assets/notice.png"></el-image>
-			<label class="notices">{{item.title}}</label>
+			   <img class="logo"  v-else   src="@/assets/notice.png"/>
+			<div class="msg">
+				<label class="notices" >{{item.title}}</label>
+				<label class="notices" >{{item.created_at}}</label>
+			</div>
 		</div>
 	</div>
 	<div v-show="list.length < 1"  style="display: flex;justify-content: center;">
@@ -22,6 +25,7 @@
 </template>
 
 <script lang="ts" setup>
+	import notice_img from "";
 	import { ref } from 'vue'
 	import { Bell } from '@element-plus/icons-vue';
 	import router from '@/router';
@@ -57,7 +61,12 @@
 </script>
 
 <style lang="scss" scoped>
-	
+	.msg{
+		width: 100%;
+		display: flex;
+		justify-content: space-between;
+		margin-right: 50px;
+	}
 	.header-title {
 	  display: flex;
 	  align-items: center;
@@ -79,4 +88,13 @@
 		width: 18px;
 		height: 18px;
 	}
+	.notices{
+		font-size: 18px;
+		margin-left: 10px;
+		line-height: 18px;;
+	}
+	.n-time-text{
+		margin-top: 5px;
+		font-size: 14px;
+	}
 </style>

+ 2 - 2
src/views/notice/mynotice/dataStatistics/todayData.vue

@@ -2,12 +2,12 @@
 	<p class="title">今日数据 <label style="color: #909399; margin-left: 50px;">注: 以下数据为当日所有小程序的累计数据,如需查看各个小程序数据,可前往<span @click="go2tj" style="color: #29d;">数据统计</span>进行查看</label></p>
 	<div class="data-line">
 		<div class="box-card">
-			<el-tooltip placement="top">
+		<!-- 	<el-tooltip placement="top">
 				<template #content> 新增用户的定义:不在其他推广链接染色时间范围内且被成功绑定到当前链接的用户,即为当前链接对应优化师的新增用户<br /> </template>
 				<el-icon>
 					<InfoFilled />
 				</el-icon>
-			</el-tooltip>
+			</el-tooltip> -->
 			<label class="text-sm">新增用户:</label>
 			<p class="text-base">{{ todayChargeData.new_user_num || '0' }}</p>
 		</div>

+ 31 - 7
src/views/notice/mynotice/index.vue

@@ -6,7 +6,7 @@
 			<noticeBlock></noticeBlock>
 		</el-card>
 
-		<el-card shadow="always" style="margin-top: 20px;">
+		<el-card shadow="always"  v-action="'statistic.HomeStatistics.statistics'"  v-ac style="margin-top: 20px;">
 			<todayData></todayData>
 		</el-card>
 	</div>
@@ -70,7 +70,7 @@ import { Bell } from '@element-plus/icons-vue';
 import { ref } from 'vue'
 
 import type { TabsPaneContext } from 'element-plus'
-import { noticesTypesList, noticeDetail, noticeRead, noticePopup } from '@/api/notice/index';
+import {noticeListMine, noticesTypesList, noticeDetail, noticeRead, noticePopup } from '@/api/notice/index';
 import showVue from '@/components/admin/buttons/show.vue';
 const api = 'system/notices/notice/mine';
 
@@ -81,14 +81,30 @@ const activeName = ref(0)
 const showAll = ref(false)
 const { data, query, search, reset, loading } = useGetList(api, true);
 const currentTableData = computed(() => data.value?.data);
+
 const readNotice = () => {
   noticeRead(notice.value.id).then(res => {
-    console.log(res);
+    // console.log(res);
     search();
   })
   centerDialogVisible.value = false
 }
-
+const getFistNotice = async () => {
+	let param  = query.value;
+	param.limit = 1;
+	await	noticeListMine(param).then(res => {
+		let temp = res.data.shift(0);
+		if(temp){
+			if(showAll.value == true){
+				titleClick(temp);
+			}
+			notice.value = temp;
+		}else{
+			notice.value = {};
+		}
+		
+	})
+};
 const initNoticeOtion = (params: object) => {
   noticesTypesList(params).then(res => {
     noticesTypes.value = res.data
@@ -97,6 +113,12 @@ const initNoticeOtion = (params: object) => {
 }
 const go2page = () =>{
 	showAll.value = !showAll.value;
+	if(showAll.value == true){
+		if(notice.value.id){
+			titleClick(notice.value);
+		}
+		
+	}
 }
 
 const titleClick = (e) => {
@@ -115,9 +137,10 @@ const handleClick = (tab: TabsPaneContext, event: Event) => {
   activeName.value = Number(tab?.props?.name)
   query.value.notice_type_id = tab.props.name;
   search();
+  getFistNotice();
 }
 
-onMounted(() => {
+onMounted(async () => {
   noticePopup().then(res => {
     if (res.data.id) {
       centerDialogVisible.value = true;
@@ -127,8 +150,9 @@ onMounted(() => {
     }
   })
   query.value.notice_type_id = activeName;
-  search();
-  initNoticeOtion({})
+	await search();
+	initNoticeOtion({})
+	getFistNotice();
 });
 </script>