tanxue 2 kuukautta sitten
vanhempi
commit
f72e70103a
5 muutettua tiedostoa jossa 107 lisäystä ja 24 poistoa
  1. 24 0
      api/shouye.js
  2. 30 0
      common/styles/global/pages.scss
  3. 1 1
      pages.json
  4. 36 11
      pages/admin/tongzhi/details.vue
  5. 16 12
      pages/admin/tongzhi/list.vue

+ 24 - 0
api/shouye.js

@@ -10,4 +10,28 @@ export function getAppIndexInfo(data = {}) {
     data,
     timeout: 20000
   })
+}
+
+export function getAppNoticeList(data = {}) {
+  return request({
+    'url': '/app/notice/list',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+export function getAppNoticeInfo(data = {}) {
+  return request({
+    'url': '/app/notice/info',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
 }

+ 30 - 0
common/styles/global/pages.scss

@@ -570,4 +570,34 @@
 		padding: 42rpx 0 24rpx;border-top: 1rpx solid #f8f9fd;margin-top: 24rpx;}
 		.scbg-btn{font-size: 28rpx;margin: 20rpx 8rpx 10rpx;}
 	}
+}
+
+/*** 消息列表 ***/
+.phone-tongzhi-list{
+	.uni-list-item__container{padding: 0!important;}
+	.xiaoxi-list-card-box{
+		width: 100%;
+	}
+	.card-head-row{
+		width: 100%;display: flex;align-items: center;border-bottom: 1rpx solid #f4f6fa;
+		padding: 10rpx 20rpx;box-sizing: border-box;justify-content: space-between;
+		.head-name{font-size: 32rpx;color:#49be89;}
+		.head-createTime{font-size: 28rpx;color:#969495;margin-left: auto;flex-shrink: 0;}
+		icon{width: 24rpx;height: 24rpx;@include ezy-no-repeat-cover;flex-shrink: 0;
+			background-image: url("@/static/images/common/nav-bar-jt-bottom.svg");
+			transform: rotate(270deg);margin-left:4rpx;}
+	}
+	.card-content{
+		width: 100%;height: 98rpx;padding:16rpx 20rpx;box-sizing: border-box;@include multi-line-ellipsis(2);line-height: 1.4;
+		@include ezy-rich-text();font-size: 28rpx;color:#8e8e8e;
+	}
+}
+
+/*** 消息详情 ***/
+.phone-tongzhi-page{
+	width: 100%;height: 100vh;display: flex;flex-direction: column;text-align: center;
+	.tongzhi-body-box{box-sizing: border-box;padding: 20rpx;flex: 1;overflow: auto;}
+	.tongzhi-name{font-size: 32rpx;color:#333;margin-bottom: 24rpx;line-height: 1.6;}
+	.tongzhi-time{font-size: 28rpx;color:#969495;margin-bottom: 24rpx;}
+	.tongzhi-content{font-size: 28rpx;color:#666;text-align: left;line-height: 1.6;}
 }

+ 1 - 1
pages.json

@@ -187,7 +187,7 @@
 			}
 		},
 		{
-			"path" : "pages/admin/tongzhi/index",
+			"path" : "pages/admin/tongzhi/list",
 			"style" : 
 			{
 				"navigationStyle": "custom"

+ 36 - 11
pages/admin/tongzhi/details.vue

@@ -1,19 +1,44 @@
 <template>
-	<view>
-		
+	<view class="phone-tongzhi-page">
+		<view class="icon-title-navBar-box">
+			<view @click="goUpPage" class="nav-bar-icon"></view>
+			<text class="nav-bar-title">{{tzData.name}}</text>
+		</view>
+		<view class="tongzhi-body-box">
+			<!-- <view class="tongzhi-name">{{tzData.name}}</view> -->
+			<view class="tongzhi-time">{{tzData.time}}</view>
+			<rich-text :nodes="tzData.content" class="tongzhi-content"></rich-text>
+		</view>
 	</view>
 </template>
 
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			
+<script setup>
+	import {onLoad,onShow} from '@dcloudio/uni-app';
+	import {getAppNoticeInfo} from '@/api/shouye.js'
+	import {ref,reactive} from "vue"
+	const tzData = reactive({
+		name: '',
+		time: '',
+		content: '',
+	})
+	onLoad((options) => {
+		console.log(options,'options');
+		initPage(options);
+	})
+	function goUpPage(){
+		uni.redirectTo({
+			url: '/pages/admin/tongzhi/list'
+		})
+	}
+	function initPage(options) {
+		const opt = {
+			noticeId: options.noticeId,
 		}
+		getAppNoticeInfo(opt).then(res => {
+			tzData.name = res.data.name;
+			tzData.time = res.data.createTime;
+			tzData.content = res.data.content;
+		})
 	}
 </script>
 

+ 16 - 12
pages/admin/tongzhi/index.vue → pages/admin/tongzhi/list.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="phone-list-page kecheng-list">
-		<view class="icon-title-bjcolor-navBar-box">
+	<view class="phone-list-page phone-tongzhi-list">
+		<view class="icon-title-navBar-box">
 			<view @click="goUpPage" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">消息管理</text>
 		</view>
@@ -12,10 +12,12 @@
 				<uni-list-item v-for="item in data.list" class="admin-list-item-box">
 					<template v-slot:body>
 						<view class="xiaoxi-list-card-box" @click="checkKecheng(item)">
-								<view class="card-name">{{item.zyName}}</view>
-								<view>{{item.zyName}}{{item.zyLevelName}}</view>
-								<view>课时:{{formatSecondsToCnhms(item.period, true)}}</view>
-								<view>{{item.createTime}}</view>
+							<view class="card-head-row">
+								<view class="head-name">{{item.name}}</view>
+								<view class="head-createTime">{{formatTime(item.createTime)}}</view>
+								<icon></icon>
+							</view>
+							<rich-text :nodes="item.content" class="card-content"></rich-text>
 						</view>
 					</template>
 				</uni-list-item>
@@ -39,7 +41,7 @@
 		onLoad,
 		onShow
 	} from "@dcloudio/uni-app";
-	import * as kechengApi from "@/api/kecheng.js"
+	import {getAppNoticeList} from '@/api/shouye.js'
 	import {
 		formatSecondsToCnhms
 	} from "@/utils/common.js"
@@ -59,6 +61,10 @@
 		from: ''
 	})
 
+	function formatTime(data){
+		console.log(data.split(' ')[0],'data.split()[0]');
+		return data.split(' ')[0];
+	}
 	function goUpPage() {
 
 		const pages = getCurrentPages();
@@ -81,7 +87,7 @@
 
 	function checkKecheng(item) {
 		uni.navigateTo({
-			url: `/pages/client/Kecheng/study?kcId=${item.kcId}&from=kechengList`
+			url: `/pages/admin/tongzhi/details?noticeId=${item.noticeId}`
 		})
 	}
 
@@ -96,7 +102,6 @@
 		const opt = {
 			page: 1,
 			size: 10, // 固定查询10条
-			zyName: data.zyName
 		}
 		data.list = [];
 		// 数学
@@ -104,7 +109,7 @@
 		data.page++;
 		opt.page = data.page;
 
-		kechengApi.getClientKechengList(opt).then(res => {
+		getAppNoticeList(opt).then(res => {
 			data.list = data.list.concat(res.data.data);
 			data.loading = false;
 
@@ -125,13 +130,12 @@
 		const opt = {
 			page: 1,
 			size: 10, // 固定查询10条
-			zyName: data.zyName
 		}
 		if (data.state == 'no-more') return;
 		data.state = 'loading';
 		data.page++;
 		opt.page = data.page;
-		kechengApi.getClientKechengList(opt).then(res => {
+		getAppNoticeList(opt).then(res => {
 			data.list = data.list.concat(res.data.data);
 			data.loading = false;