123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- <template>
- <view class="dljt-index-page">
- <MtaNavbar></MtaNavbar>
- <view class="index-swiper-box">
- <swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="5000">
- <swiper-item v-for="item in banners" :key="item.id" @click="handleBannerSelect(item)">
- <image :src="item.pic"></image>
- </swiper-item>
- </swiper>
- </view>
- <view class="index-content-box">
- <listTwoVue v-for="item in data.xinwen" :key="item.id" :data="item" @click.native="handleClickXinwen(item)"
- class=index-xinwen-box></listTwoVue>
- <view class="index-more-btn" v-if="data.xinwenTotal>3">
- <text @click="handleXinwenGengDuo">更多</text>
- <icon @click="handleXinwenGengDuo"></icon>
- </view>
- </view>
- <view class="index-background-box">
- <view class="index-content-box">
- <view class="tab-item"><icon class="tzgg-icon"></icon><text>通知公告</text></view>
- <view class="index-list-item" v-for="item in data.gonggao" :key="item.id" @click="handleClickGonggao(item)">
- <view class="list-createTime">{{item.createTime}}</view>
- <view class="list-title">{{item.title}}</view>
- </view>
- <view class="index-more-btn more-btn-top" v-if="data.xiaowuTotal>5">
- <text @click="getTongzhigengduo">更多</text>
- <icon @click="getTongzhigengduo"></icon>
- </view>
- </view>
- </view>
- <view class="index-background-box">
- <view class="index-content-box">
- <view class="tab-item"><icon class="xwgk-icon"></icon><text>校务公开</text></view>
- <view class="index-list-item" v-for="item in data.xiaowu" :key="item.id" @click="handleClickXiaowu(item)">
- <view class="list-createTime">{{item.createTime}}</view>
- <view class="list-title">{{item.title}}</view>
- </view>
- <view class="index-more-btn more-btn-top" v-if="data.xiaowuTotal>5">
- <text @click="getXiaowuGengduo">更多</text>
- <icon @click="getXiaowuGengduo"></icon></view>
- </view>
- </view>
- <!-- 招生就业 -->
- <view class="index-content-box zsjy-box">
- <view class="tab-item zsjy-tab-item"><icon class="zsjy-icon"></icon><text>招生就业</text></view>
- <view class="wnlqfs-box" @click="goFun('wnlqfs')">
- <view class="zsjy-text">往年录取分数</view>
- </view>
- <view class="xqhz-box" @click="goFun('xwhz')">
- <view class="zsjy-text">校企合作</view>
- </view>
- </view>
- <MtaFooter></MtaFooter>
- <!-- 底部导航 -->
- <!-- <MtaTabBar></MtaTabBar> -->
- <view :class="indexMenu" @click="menuClick">
- <view :class="indexList">
- <view class="index-text-btn" @click="goFun('zsrx')">招生<br/>热线</view>
- <view class="index-text-btn" @click="goFun('ewm')">首页<br/>二维码</view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import {
- ref,
- reactive
- } from "vue";
- import {
- onLoad
- } from "@dcloudio/uni-app"
- import * as httpApi from "@/api/common.js"
- import MtaNavbar from "@/components/MtaNavbar/MtaNavbar.vue";
- import listTwoVue from "@/components/MtaCard/listTwo.vue";
- import MtaTabBar from "@/components/MtaTabBar/MtaTabBar.vue";
- import MtaFooter from "@/components/MtaFooter.vue"
- import default2 from '@/static/images/common/news-bj2.png'
- let indexMenu = ref('index-menu-btn');
- let indexList = ref('index-text-list-hiden');
- const banners = ref('');
- const data = reactive({
- xinwen: [],
- xinwenTotal: 0,
- gonggao: [],
- gonggaoTotal: 0,
- xiaowu: [],
- xiaowuTotal: 0,
- isGonggao: true,
- })
- onLoad(() => {
- pageInit();
- })
-
- function menuClick(){
- if(indexMenu.value==='index-menu-btn'){
- indexMenu.value='index-close-btn'
- indexList.value='index-text-list-show'
- }else{
- indexMenu.value='index-menu-btn'
- indexList.value='index-text-list-hiden'
- }
- }
-
- function goFun(code) {
- if (code == 'wnlqfs') {
- uni.navigateTo({
- url: '/pages/zsjyWangnianluqufenshu/zsjyWangnianluqufenshu'
- })
- }else if (code == 'zsrx') {
- uni.navigateTo({
- url: '/pages/zhaoshengrexian/zhaoshengrexian'
- })
- }else if (code == 'ewm') {
- uni.navigateTo({
- url: '/pages/erweima/erweima'
- })
- }else {
- uni.navigateTo({
- url: '/pages/zsjyXiaoqihezuo/zsjyXiaoqihezuo'
- })
- }
- }
- function handleClickXinwen(item) {
- uni.navigateTo({
- url:`/pages/xydtXueyuanxinwenInfo/xydtXueyuanxinwenInfo?id=${item.id}`
- })
- }
- function getXiaowuGengduo() {
- uni.navigateTo({
- url: `/pages/xydtXiaowugongkai/xydtXiaowugongkai`
- })
- }
-
- function handleClickGonggao(item) {
- uni.navigateTo({
- url:`/pages/xydtTongzhigonggaoInfo/xydtTongzhigonggaoInfo?id=${item.id}`
- })
- }
- function handleClickXiaowu(item) {
- uni.navigateTo({
- url: `/pages/xydtXiaowugongkaiInfo/xydtXiaowugongkaiInfo?id=${item.id}`
- })
- }
- function getTongzhigengduo() {
- uni.navigateTo({
- url: `/pages/xydtTongzhigonggao/xydtTongzhigonggao`
- })
- }
- function handleXinwenGengDuo() {
- uni.navigateTo({
- url: `/pages/xydtXueyuanxingwen/xydtXueyuanxingwen`
- })
- }
- function handleBannerSelect(item) {
- if (item.url) {
- window.location.href = item.url;
- }
- }
- function changeGonggao() {
- if (this.isGonggao) {
- return true
- }
- data.isGonggao = true;
- getGonggao()
- }
- function changeXiaowu() {
- if (!this.isGonggao) {
- return true
- }
- data.isGonggao = false;
- getXiaowu()
- }
- function getGonggao() {
- httpApi.getCommonXinwenTongzhiList().then(res => {
- data.gonggao = res.data.data;
- data.gonggaoTotal = res.data.total;
- })
- }
- function getXiaowu() {
- httpApi.getCommonXinwenXiaowuList().then(res => {
- data.xiaowu = res.data.data;
- data.xiaowuTotal = res.data.total;
- })
- }
- function pageInit() {
- Promise.all([
- httpApi.getCommonBanners({
- size: 1000
- }),
- httpApi.getCommonXinwenYuanxiaoList({
- page: 1,
- size: 3
- }),
- httpApi.getCommonXinwenTongzhiList({
- page: 1,
- size: 5
- }),
- httpApi.getCommonXinwenXiaowuList({
- page: 1,
- size: 5
- })
- ]).then(([res1, res2, res3, res4]) => {
- banners.value = res1.data.data;
- data.xinwen = res2.data.data;
- data.xinwenTotal = res2.data.total;
- data.gonggao = res3.data.data;
- data.gonggaoTotal = res3.data.total;
- data.xiaowu = res4.data.data;
- data.xiaowuTotal = res4.data.total;
- })
- }
- </script>
- <style lang="scss">
- </style>
|