|
@@ -1,6 +1,6 @@
|
|
|
<script setup>
|
|
|
import user from '~/store/user';
|
|
|
-import { child } from '~/store/child';
|
|
|
+import { child, setChild } from '~/store/child';
|
|
|
|
|
|
import img_bg from '~/assets/home/bg.png';
|
|
|
import img_banner1 from '~/assets/home/banner1.png';
|
|
@@ -30,40 +30,42 @@ function gridHandle(item) {
|
|
|
if (
|
|
|
item.text == '线上课堂' ||
|
|
|
item.text == '云尚活动' ||
|
|
|
- item.text == '校长信箱')
|
|
|
- {
|
|
|
+ item.text == '校长信箱') {
|
|
|
showToast('该模块正在开发中~');
|
|
|
};
|
|
|
if (item.text == '社团选课') {
|
|
|
- if (user._role=='others') {
|
|
|
- window.open('https://nmlm.bozedu.net/login.html?redirect=/stxk','_self')
|
|
|
- } else {
|
|
|
- switch (user._role) {
|
|
|
- case 'jz':
|
|
|
- if(!child){
|
|
|
- return showToast('家长需绑定孩子方可进入')
|
|
|
- }
|
|
|
- window.open('https://nmlm.bozedu.net/#/stxk/jz', '_self')
|
|
|
- return
|
|
|
- // return itemRoute = '/stxk/jz'
|
|
|
- case 'js':
|
|
|
- window.open('https://nmlm.bozedu.net/#/stxk_teacher', '_self')
|
|
|
- return
|
|
|
- // return itemRoute = '/stxk_teacher'
|
|
|
- case 'xz':
|
|
|
- window.open('https://nmlm.bozedu.net/#/stxkjsd', '_self')
|
|
|
- return
|
|
|
- // return itemRoute = '/stxkjsd'
|
|
|
- }
|
|
|
+ if (user._role == 'others') {
|
|
|
+ window.open('https://nmlm.bozedu.net/login.html?redirect=/stxk', '_self')
|
|
|
+ } else {
|
|
|
+ switch (user._role) {
|
|
|
+ case 'jz':
|
|
|
+ // if(!child){
|
|
|
+ // return showToast('家长需绑定孩子方可进入')
|
|
|
+ // }
|
|
|
+ // window.open('https://nmlm.bozedu.net/#/stxk/jz', '_self')
|
|
|
+ router.push('/stxk/jz')
|
|
|
+ return
|
|
|
+ // return itemRoute = '/stxk/jz'
|
|
|
+ case 'js':
|
|
|
+ // window.open('https://nmlm.bozedu.net/#/stxk_teacher', '_self')
|
|
|
+ router.push('/stxk_teacher')
|
|
|
+ return
|
|
|
+ // return itemRoute = '/stxk_teacher'
|
|
|
+ case 'xz':
|
|
|
+ // window.open('https://nmlm.bozedu.net/#/stxkjsd', '_self')
|
|
|
+ router.push('/stxkjsd')
|
|
|
+ return
|
|
|
+ // return itemRoute = '/stxkjsd'
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
const gridList = [
|
|
|
{ icon: img_djzl, text: '党建专栏', to: () => '/djzl' },
|
|
|
{ icon: img_qzzx, text: '求真在线', to: () => '/qzzx' },
|
|
|
{ icon: img_xskt, text: '线上课堂', to: () => '' },
|
|
|
- {icon: img_stxk, text: '社团选课', to: () => ''},
|
|
|
+ { icon: img_stxk, text: '社团选课', to: () => '' },
|
|
|
{ icon: img_jscz, text: '教师成长', to: () => '/jscz', permission: ['js', 'xz'].includes(user._role) },
|
|
|
{ icon: img_yshd, text: '云尚活动', to: () => '' },
|
|
|
{ icon: img_xzxx, text: '校长信箱', to: () => '' },
|
|
@@ -78,7 +80,7 @@ let nic_id;
|
|
|
request({
|
|
|
url: '/news/info_cate/api_tree',
|
|
|
data: {
|
|
|
- token: user._role === 'jz' ? ( child ? child.token : "") : user.token
|
|
|
+ token: user._role === 'jz' ? (child ? child.token : "") : user.token
|
|
|
}
|
|
|
}).then(res => {
|
|
|
cateData = res.data;
|
|
@@ -91,7 +93,7 @@ request({
|
|
|
data: {
|
|
|
nic_id: nic_id,
|
|
|
urltype: 1,
|
|
|
- token: user._role === 'jz' ? ( child ? child.token : ""): user.token
|
|
|
+ token: user._role === 'jz' ? (child ? child.token : "") : user.token
|
|
|
}
|
|
|
}).then(res => {
|
|
|
notice = res.data.page_data[0];
|
|
@@ -118,15 +120,17 @@ function initData() {
|
|
|
}).then((res) => {
|
|
|
if (res.code == "1") {
|
|
|
childrenList = res.data.info;
|
|
|
+ sessionStorage.setItem("children", JSON.stringify(res.data.info));
|
|
|
+ // setChild(res.data.info[0]);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
initData();
|
|
|
|
|
|
function register() {
|
|
|
- if(user.token){
|
|
|
+ if (user.token) {
|
|
|
router.push('/xszc')
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
router.push('/zcdl');
|
|
|
}
|
|
|
}
|
|
@@ -142,12 +146,11 @@ function routerLink() {
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
-
|
|
|
<div class="flex flex-col justify-center p-4 relative bg-no-repeat bg-contain"
|
|
|
:style="{ backgroundImage: `url(${img_bg})` }">
|
|
|
<!-- <van-config-provider :theme-vars="{ 'search-padding': 0 }">
|
|
|
- <van-search v-model="searchText" placeholder="" />
|
|
|
- </van-config-provider> -->
|
|
|
+ <van-search v-model="searchText" placeholder="" />
|
|
|
+ </van-config-provider> -->
|
|
|
<van-swipe :autoplay="3000" lazy-render class="rounded-md shadow-md mt-4 min-w-270px">
|
|
|
<van-swipe-item v-for="image in images" :key="image">
|
|
|
<img :src="image" class="w-full" />
|
|
@@ -156,26 +159,27 @@ function routerLink() {
|
|
|
<img @click="register()" src="../../assets/home/banner3.png" style="height:100%" class="w-full" alt="">
|
|
|
</van-swipe-item>
|
|
|
</van-swipe>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
<van-grid :gutter="0" class="" icon-size="65px">
|
|
|
- <template v-for="item in gridList" :key="item.text">
|
|
|
- <van-grid-item v-if="item.permission || item.permission === undefined" :icon="item.icon" :text="item.text"
|
|
|
- :to="item.to()" @click="gridHandle(item)" />
|
|
|
- </template>
|
|
|
- </van-grid>
|
|
|
+ <template v-for="item in gridList" :key="item.text">
|
|
|
+ <van-grid-item v-if="item.permission || item.permission === undefined" :icon="item.icon" :text="item.text"
|
|
|
+ :to="item.to()" @click="gridHandle(item)" />
|
|
|
+ </template>
|
|
|
+ </van-grid>
|
|
|
<div class="px-4 flex w-full notice">
|
|
|
- <div class="w-40 h-full">
|
|
|
+ <div class="w-40 h-full">
|
|
|
<img class="w-19 mt-5.4" src="../../assets/images/-s-6.png" alt="">
|
|
|
</div>
|
|
|
<div class="text truncate cursor-pointer" @click="routerLink">
|
|
|
- {{notice.name}}
|
|
|
+ {{ notice.name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<van-tabs sticky swipeable>
|
|
|
<van-tab v-for="cate in cateData" :title="cate.nic_name">
|
|
|
<remote-list url="/news/info/index"
|
|
|
- :d="{ nic_id: cate.nic_id, urltype: 1, token: user._role === 'jz' ? ( child ? child.token : ''): user.token }" class="mt-2">
|
|
|
+ :d="{ nic_id: cate.nic_id, urltype: 1, token: user._role === 'jz' ? (child ? child.token : '') : user.token }"
|
|
|
+ class="mt-2">
|
|
|
<template #default="{ row: item }">
|
|
|
<van-card :title="item.name" :thumb="item.img" @click="handleClickCard(item)">
|
|
|
<template #price>
|
|
@@ -210,52 +214,60 @@ function routerLink() {
|
|
|
.van-grid {
|
|
|
width: 100%;
|
|
|
}
|
|
|
-.van-grid-item{
|
|
|
+
|
|
|
+.van-grid-item {
|
|
|
width: 100px;
|
|
|
}
|
|
|
- .van-tabs{
|
|
|
+
|
|
|
+.van-tabs {
|
|
|
padding: 0 10px !important;
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
-.van-card{
|
|
|
+
|
|
|
+.van-card {
|
|
|
background-color: #fff;
|
|
|
}
|
|
|
- .notice{
|
|
|
- width: 100%;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- height: 60px;
|
|
|
+
|
|
|
+.notice {
|
|
|
+ width: 100%;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 60px;
|
|
|
+ line-height: 60px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-top: 1.19px solid #D8E2F0;
|
|
|
+ border-bottom: 1.19px solid #D8E2F0;
|
|
|
+
|
|
|
+ img {
|
|
|
line-height: 60px;
|
|
|
- background-color: #fff;
|
|
|
- border-top: 1.19px solid #D8E2F0;
|
|
|
- border-bottom: 1.19px solid #D8E2F0;
|
|
|
- img{
|
|
|
- line-height: 60px;
|
|
|
- }
|
|
|
- .text{
|
|
|
- height: 60px;
|
|
|
- line-height: 65px;
|
|
|
- }
|
|
|
}
|
|
|
- .tz{
|
|
|
- width: 40%;
|
|
|
- vertical-align: middle;
|
|
|
- font-size: 26px;
|
|
|
- font-family: Regular;
|
|
|
- text-align: center;
|
|
|
- color: #747474;
|
|
|
- letter-spacing: 0px;
|
|
|
- }
|
|
|
- .gg{
|
|
|
- vertical-align: text-top;
|
|
|
- display: inline-block;
|
|
|
- width: 30%;
|
|
|
- height: 23px;
|
|
|
- line-height: 23px;
|
|
|
- text-align: center;
|
|
|
- background: #ff8700;
|
|
|
- border-radius: 4px;
|
|
|
- font-size: 3vw;
|
|
|
- color: #fff;
|
|
|
+
|
|
|
+ .text {
|
|
|
+ height: 60px;
|
|
|
+ line-height: 65px;
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+.tz {
|
|
|
+ width: 40%;
|
|
|
+ vertical-align: middle;
|
|
|
+ font-size: 26px;
|
|
|
+ font-family: Regular;
|
|
|
+ text-align: center;
|
|
|
+ color: #747474;
|
|
|
+ letter-spacing: 0px;
|
|
|
+}
|
|
|
+
|
|
|
+.gg {
|
|
|
+ vertical-align: text-top;
|
|
|
+ display: inline-block;
|
|
|
+ width: 30%;
|
|
|
+ height: 23px;
|
|
|
+ line-height: 23px;
|
|
|
+ text-align: center;
|
|
|
+ background: #ff8700;
|
|
|
+ border-radius: 4px;
|
|
|
+ font-size: 3vw;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
</style>
|