wangxy 2 месяцев назад
Родитель
Сommit
a4650c936e

+ 24 - 0
api/common.js

@@ -826,4 +826,28 @@ export function getCommonZhengcewenjianInfo(data = {}) {
 		data,
 		timeout: 20000
 	})
+}
+
+export function getCommonZypxTongzhiList(data = {}) {
+	return request({
+		'url': '/common/zhiyepeixun/tongzhi/list',
+		headers: {
+			isToken: false
+		},
+		method: 'post',
+		data,
+		timeout: 20000
+	})
+}
+
+export function getCommonZypxTongzhiInfo(data = {}) {
+	return request({
+		'url': '/common/zhiyepeixun/tongzhi/info',
+		headers: {
+			isToken: false
+		},
+		method: 'post',
+		data,
+		timeout: 20000
+	})
 }

+ 67 - 22
pages/zypxTongzhigonggao/zypxTongzhigonggao.vue

@@ -1,30 +1,75 @@
 <template>
-	<view>
-		
-	</view>
+  <view class="dljt-page-box">
+    <MtaNavbar></MtaNavbar>
+    <view class="dljt-container-box">
+      <view class="dljt-page-title">教育教学</view>
+      <view class="dljt-page-content-box">
+        <view class="dljt-breadcrumb-box">
+          <view class="breadcrumb-text" @click="handleGo()">首页</view>
+          <icon class="breadcrumb-jt"></icon>
+          <view class="breadcrumb-text">职业培训</view>
+          <icon class="breadcrumb-jt"></icon>
+          <view class="breadcrumb-active">通知公告</view>
+        </view>
+        <MtaScrollViewVue :refreshFn="getList">
+          <template v-slot="{ list }">
+            <view class="data-content-item" v-for="item in list" :key="item.id" @click="handleClick(item)">
+              <view class="list-time-box">
+                <view class="time-data">{{formatDateToYearMonthDay(item.createTime)[1]}}</view>
+                <view class="time-year">{{formatDateToYearMonthDay(item.createTime)[0]}}</view>
+              </view>
+              <view class="list-title-box"> {{item.title}} </view>
+            </view>
+          </template>
+        </MtaScrollViewVue>
+      </view>
+      <!-- 底部导航 -->
+      <MtaFooter></MtaFooter>
+    </view>
+  </view>
 </template>
 
 <script setup>
-	import {
-		ref,
-		reactive
-	} from "vue";
-	import {
-		onLoad
-	} from "@dcloudio/uni-app"
-	import * as httpApi from "@/api/common.js"
-	
-	
-	const data = reactive({
-		content: ''
-	})
-	
-	onLoad(() => {
-		pageInit();
-	})
-	
+import {
+  ref,
+  reactive
+} from "vue";
+import {
+  onLoad
+} from "@dcloudio/uni-app"
+import * as httpApi from "@/api/common.js"
+import MtaScrollViewVue from "@/components/MtaScrollView/MtaScrollView.vue";
+import {
+  formatDateToYearMonthDay,
+  getStringByHtml3
+} from "@/utils/common.js"
+import MtaFooter from "@/components/MtaFooter.vue"
+import {getCommonZypxTongzhiList} from "../../api/common";
+
+const data = reactive({
+  list: '',
+  total: '',
+  page: 1,
+  size: 5
+})
+
+function handleClick(data) {
+  uni.navigateTo({
+    url: `/pages/zypxTongzhigonggaoInfo/zypxTongzhigonggaoInfo?id=${data.id}`
+  })
+}
+
+function getList(data) {
+  return httpApi.getCommonZypxTongzhiList(data)
+}
+
+function handleGo() {
+  uni.navigateTo({
+    url: '/pages/index/index'
+  })
+}
 	function pageInit() {
-		httpApi.getCommonGaikuangJigouShezhiInfo().then(res => {
+		httpApi.getCommonZypxTongzhiList().then(res => {
 			data.content = res.data.content;
 		})
 	}

+ 81 - 12
pages/zypxTongzhigonggaoInfo/zypxTongzhigonggaoInfo.vue

@@ -1,35 +1,104 @@
 <template>
-	<view>
-		
+	<view class="dljt-page-box" v-if="data.info">
+		<MtaNavbar></MtaNavbar>
+		<view class="dljt-container-box">
+			<!-- 详情页面 -->
+			<view class="dljt-page-title">职业培训</view>
+			<view class="dljt-page-content-box">
+				<!-- 导航 -->
+				<view class="dljt-breadcrumb-box">
+					<view class="breadcrumb-text" @click="handleGo('shouye')">首页</view>
+					<icon class="breadcrumb-jt"></icon>
+					<view class="breadcrumb-text">职业培训</view>
+					<icon class="breadcrumb-jt"></icon>
+					<view class="breadcrumb-text" @click="handleGo('tzgg')">通知公告</view>
+					<icon class="breadcrumb-jt"></icon>
+					<view class="breadcrumb-active">详情</view>
+				</view>
+				<view class="dljt-detail-box">
+					<!-- 标题 -->
+					<view class="detail-title">{{data.info.title}}</view>
+					<!-- 时间 -->
+					<view class="detail-data">{{formatDate.join('-') }}</view>
+					<!-- 富文本 -->
+					<MtaMpHtml class="dljt-editor-box" :content="data.info.content"></MtaMpHtml>
+
+				</view>
+			</view>
+		</view>
+		<!-- 底部导航 -->
+		<MtaFooter></MtaFooter>
 	</view>
 </template>
 
 <script setup>
 	import {
 		ref,
-		reactive
+		reactive,
+		computed,
+		onMounted,
+		onUnmounted
 	} from "vue";
 	import {
 		onLoad
 	} from "@dcloudio/uni-app"
 	import * as httpApi from "@/api/common.js"
-	
-	
+	import {
+		formatDateToYearMonthDay
+	} from "@/utils/common.js"
+	import MtaMpHtml from "@/components/MTAMpHtml/MtaMpHtml.vue"
+	import MtaPDFVue from "@/components/MtaPDF.vue";
+	import MtaFooter from "@/components/MtaFooter.vue"
+	import {
+		getCommonZypxTongzhiInfo
+	} from "../../api/common";
 	const data = reactive({
-		content: ''
+		info: null,
+		id: null
+	})
+	const formatDate = computed(() => {
+		if (data.info && data.info.createTime) {
+			return formatDateToYearMonthDay(data.info.createTime)
+		}
+		return []
 	})
-	
-	onLoad(() => {
+
+
+	onLoad(({
+		id
+	}) => {
+		data.id = id;
 		pageInit();
 	})
-	
+
+
+	function handleGo(code) {
+		if (code == 'shouye') {
+			uni.navigateTo({
+				url: '/pages/index/index'
+			})
+		}
+		if (code == 'tzgg') {
+			uni.navigateTo({
+				url: '/pages/zypxTongzhigonggao/zypxTongzhigonggao'
+			})
+		}
+	}
+
+	function handleDownFile() {
+		window.location.href = pdfUrl;
+	}
+
+
 	function pageInit() {
-		httpApi.getCommonGaikuangJigouShezhiInfo().then(res => {
-			data.content = res.data.content;
+		httpApi.getCommonZypxTongzhiInfo({
+			id: data.id
+		}).then(res => {
+			data.info = res.data;
 		})
 	}
 </script>
 
 <style>
 
-</style>
+</style>