|
|
@@ -1,7 +1,15 @@
|
|
|
<template>
|
|
|
<view class="page_workspace"
|
|
|
- :style="{ paddingTop: statusBarHeight + 160 + 'rpx', paddingBottom: safeAreaBottom + 150 + 'rpx' }">
|
|
|
- <pageHeader></pageHeader>
|
|
|
+ :style="{ paddingBottom: safeAreaBottom + 150 + 'rpx' }">
|
|
|
+ <!-- <pageHeader></pageHeader> -->
|
|
|
+ <nav-bar height="112" :title="state.schoolName" rightType="select" :onlyTitle="false" :showFilterPicker="false" :showTabs="false" :showTabBtns="false" leftWidth="0rpx" rightWidth="0rpx">
|
|
|
+ <template #headRightIcon>
|
|
|
+ <view class="select_box" v-if="schoolsList?.length>1" @click="ChangeSchoolInfo">
|
|
|
+ <view class="select_label">切换学校</view>
|
|
|
+ <image src="@/static/image/icon/arrow_down.png" class="select_icon"></image>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </nav-bar>
|
|
|
<scroll-view scroll-y class="workspace_content">
|
|
|
<!-- 系统列表 -->
|
|
|
<view class="system_list">
|
|
|
@@ -143,18 +151,33 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<common-tabbar></common-tabbar>
|
|
|
+ <!-- 提示框 -->
|
|
|
+ <popup-dialog ref="schoolPopupDialogRef" popType="custom" title="选择学校" @DialogConfirm="DialogSchoolConfirm">
|
|
|
+ <view class="school_list">
|
|
|
+ <view :class="['list_item',{active:state.schoolId==item.schoolId}]" @click="SelectSchool(item.schoolId)" v-for="item in schoolsList" :key="item.schoolId">
|
|
|
+ <view class="school_logo">
|
|
|
+ <image class="logo" v-if="item.schoolLogoUrl" :src="item.schoolLogoUrl"></image>
|
|
|
+ <image class="logo" v-else src="@/static/image/bg/default_user.png"></image>
|
|
|
+ </view>
|
|
|
+ <text class="school_name">{{item.schoolName}}</text>
|
|
|
+ <uni-icons class="item_right" type="right"></uni-icons>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </popup-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, onMounted, computed } from 'vue';
|
|
|
+import { ref, onMounted,reactive, computed } from 'vue';
|
|
|
import { onShow } from '@dcloudio/uni-app';
|
|
|
import { useStore } from 'vuex';
|
|
|
import workspaceApi from '@/reqApi/workspace.js';
|
|
|
-import PageHeader from '@/components/pageHeader.vue';
|
|
|
+import navBar from '@/components/navBar.vue';
|
|
|
+import popupDialog from '@/components/popupDialog.vue';
|
|
|
+// import PageHeader from '@/components/pageHeader.vue';
|
|
|
import NoData from '@/components/noData.vue';
|
|
|
import CommonTabbar from '@/components/commonTabbar.vue';
|
|
|
import { useSafeArea } from '@/common/safeArea';
|
|
|
-
|
|
|
+import user from '@/reqApi/user.js';
|
|
|
|
|
|
|
|
|
const store = useStore();
|
|
|
@@ -175,7 +198,12 @@ const systemItems = ref([
|
|
|
{ name: '听课评课', id: '11', key: '', image: '/static/image/workspace/icon11.png', isLarge: false, visible: true },
|
|
|
{ name: '基础数据', id: '2', key: '', image: '/static/image/workspace/icon12.png', isLarge: false, visible: true }
|
|
|
]);
|
|
|
-
|
|
|
+const schoolPopupDialogRef = ref(null);//选择学校
|
|
|
+const schoolsList = computed(()=>store.state.userStore.schoolsList);
|
|
|
+const state = reactive({
|
|
|
+ schoolName:'',
|
|
|
+ schoolId:''
|
|
|
+});
|
|
|
const modulesList = ref([]);
|
|
|
const moduleMap = computed(() => {
|
|
|
const map = {};
|
|
|
@@ -328,6 +356,7 @@ const updateYearMonthIndex = () => {
|
|
|
};
|
|
|
|
|
|
onMounted(() => {
|
|
|
+ getSchoolInfo();
|
|
|
initSafeArea();
|
|
|
generateYearList();
|
|
|
generateMonthList();
|
|
|
@@ -454,6 +483,31 @@ const handleConfirmSchedule = async () => {
|
|
|
uni.showToast({ title: '添加日程失败,请稍后重试', icon: 'none', duration: 3000 });
|
|
|
}
|
|
|
};
|
|
|
+//获取学生信息
|
|
|
+const getSchoolInfo = () => {
|
|
|
+ state.schoolName = store.state.userStore.userInfo.schoolName;
|
|
|
+ console.log(state.schoolName,323233)
|
|
|
+ state.schoolId = store.state.userStore.userInfo.schoolId;
|
|
|
+}
|
|
|
+//切换学校弹框
|
|
|
+const ChangeSchoolInfo = () => {
|
|
|
+ schoolPopupDialogRef.value.OpenDialog();
|
|
|
+}
|
|
|
+const SelectSchool = (schoolId) => {
|
|
|
+ state.schoolId = schoolId;
|
|
|
+}
|
|
|
+//切换学校
|
|
|
+const DialogSchoolConfirm = () => {
|
|
|
+ user.chooseBelongSchool({
|
|
|
+ schoolId:state.schoolId,
|
|
|
+ deviceType:'APP'
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.code == 200){
|
|
|
+ state.schoolName = res?.data?.schoolName || '';
|
|
|
+ store.dispatch('setUserInfo');
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
@@ -615,7 +669,7 @@ $shadow-sm: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
|
|
right: 12rpx;
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
- z-index: 100;
|
|
|
+ z-index: 10;
|
|
|
img{
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
@@ -666,7 +720,7 @@ $shadow-sm: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
|
|
right: 12rpx;
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
- z-index: 100;
|
|
|
+ z-index: 10;
|
|
|
img{
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
@@ -1085,4 +1139,85 @@ $shadow-sm: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.select_box{
|
|
|
+ width: 168rpx;
|
|
|
+ height: 48rpx;
|
|
|
+ padding: 16rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background: rgba(46,100,250,0.1);
|
|
|
+ border-radius: 8rpx;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #2E64FA;
|
|
|
+ .select_label{
|
|
|
+ flex:1;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ .select_icon{
|
|
|
+ width: 16rpx;
|
|
|
+ height:16rpx;
|
|
|
+ margin-left: 8rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+:deep(.school_list){
|
|
|
+ padding:0 30rpx;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .list_item{
|
|
|
+ margin-top: 20rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 108rpx;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ border: 1px solid #E4E7ED;
|
|
|
+ padding: 20rpx 38rpx 20rpx 24rpx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &.active{
|
|
|
+ border: 1px solid #2E64FA;
|
|
|
+ background-color: rgba(46,100,250,0.1);
|
|
|
+ }
|
|
|
+ .school_logo{
|
|
|
+ width: 68rpx;
|
|
|
+ height: 68rpx;
|
|
|
+ background: #C2D2FF;
|
|
|
+ border-radius: 50%;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-right: 28rpx;
|
|
|
+ .logo{
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .school_name{
|
|
|
+ flex: 1;
|
|
|
+ height: 68rpx;
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #000000;
|
|
|
+ span{
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ overflow: hidden;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .item_right{
|
|
|
+ margin-left: 28rpx;
|
|
|
+ font-size: 36rpx !important;
|
|
|
+ color: #999999 !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|