123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600 |
- <template>
- <view class="mine-container" >
- <!--顶部个人信息栏-->
- <view class="home_top">
- <uni-nav-bar title="我的" :background-color="backgroundColor" :border="navborder" statusBar='true' fixed="true">
- <!-- checkPermi(['system:notice:list']) -->
- <!-- <block slot="left" >
- <view class="min_top" @click="getMessage">
- <image :src="noticimg"></image>
- <view class="circ"></view>
- </view>
- </block> -->
- </uni-nav-bar>
- </view>
- <image :src="abg" class="abg"></image>
-
- <view style="margin-top: -487rpx;position: relative;padding:0 34rpx 20rpx;">
- <view class="header_top flexc mb6" @click="handleToinfo">
- <image v-if="avatar" @click.stop="handleToAvatar" :src="baseUrl+avatar" class="flex0 limg" mode="aspectFill"></image>
- <image v-else @click.stop="handleToAvatar" :src="avatarimg" class="flex0 limg" mode="aspectFill"></image>
- <view class="flex1 hcen">
- <view class="f17 fw c16 mb8 flexc">{{name}}
- <text v-if="choseroles=='teacher'">老师</text>
- <text v-if="choseroles=='school'">学校管理员</text>
- <text v-if="choseroles=='parents'">家长</text>
- </view>
- <view class="f15 co6" v-if="choseroles=='teacher'">{{schoolName}}/{{discipline}}</view>
- <view class="f15 co6" v-else-if="choseroles!='parents'" >{{schoolName}}</view>
- </view>
- <image :src="rimg" class="flex0 rimg"></image>
- </view>
- <!-- 新样式 -->
- <view class="mnbox">
- <view class="mn_tit">学校设置</view>
- <view class="mn_list">
- <view class="mlist flexc" @click="handleClass" v-if="checkPermi(['system:dept:add'])">
- <view class="mlistl"><image :src="miconn" class="imgb"></image></view>
- <view class="mlistc">添加班级</view>
- </view>
- <view class="mlist flexc" @click="handleWord">
- <view class="mlistl"><image :src="miconk" class="imgk"></image></view>
- <view class="mlistc">口令码</view>
- </view>
- <view class="mlist flexc" @click="handleQuery">
- <view class="mlistl"><image :src="micona" class="imga"></image></view>
- <view class="mlistc">账号信息</view>
- </view>
- <view class="mlist flexc" v-if="checkPermi(['course:table:edit'])" @click="handleTime(1)">
- <view class="mlistl"><image :src="miconb" class="imgb"></image></view>
- <view class="mlistc">放学时间</view>
- </view>
- <view class="mlist flexc" v-if="checkPermi(['course:table:edit'])" @click="handleTime(2)">
- <view class="mlistl"><image :src="miconh" class="imge"></image></view>
- <view class="mlistc">延迟放学</view>
- </view>
- <view class="mlist flexc" v-if="checkPermi(['register:teacher:list','register:student:list'])" @click="handleZhaccount">
- <view class="mlistl"><image :src="micono" class="imgc"></image></view>
- <view class="mlistc">账号审核</view>
- </view>
- <!-- v-if="checkPermi(['course:change:list'])&&choseroles!='parents' -->
- <view class="mlist flexc" v-if="checkPermi(['course:change:reply'])" @click="handleTkcourse">
- <view class="mlistl"><image :src="micond" class="imgd"></image></view>
- <view class="mlistc">调课审核</view>
- </view>
- <view class="mlist flexc" @click="handlelimit">
- <view class="mlistl"><image :src="miconp" class="imga"></image></view>
- <view class="mlistc">权限授权</view>
- </view>
- <view class="mlist flexc" @click="handleAuth">
- <view class="mlistl"><image :src="micone" class="imgf"></image></view>
- <view class="mlistc">身份切换</view>
- </view>
- <view class="mlist flexc" @click="handleaddAuth">
- <view class="mlistl"><image :src="miconm" class="imga"></image></view>
- <view class="mlistc">添加角色</view>
- </view>
- <view class="mlist flexc" @click="handleClassSet" v-if="checkPermi(['formal:class:add'])&&choseroles=='teacher'">
- <view class="mlistl"><image :src="miconc" class="imgg"></image></view>
- <view class="mlistc">班级设置</view>
- </view>
- <view class="mlist flexc" @click="handleaddStu" v-if="choseroles=='parents'">
- <view class="mlistl"><image :src="miconq" class="imgg"></image></view>
- <view class="mlistc">添加学生</view>
- </view>
- <view class="mlist flexc" @click="handleCollect">
- <view class="mlistl"><image :src="miconi" class="imgc"></image></view>
- <view class="mlistc">我的收藏</view>
- </view>
- <view class="mlist flexc" @click="handleInvite" v-if="choseroles!='parents'">
- <view class="mlistl"><image :src="miconr" class="imgl"></image></view>
- <view class="mlistc">预约码</view>
- </view>
- </view>
- </view>
- <view class="mnbox">
- <view class="mn_tit">账号设置</view>
- <view class="mn_list">
- <view class="mlist flexc" @click="handleUpassword">
- <view class="mlistl"><image :src="miconj" class="imgh"></image></view>
- <view class="mlistc">修改密码</view>
- </view>
- <view class="mlist flexc" @click="handlePrivacy">
- <view class="mlistl"><image :src="miconf" class="imgd"></image></view>
- <view class="mlistc">用户协议</view>
- </view>
- <view class="mlist flexc" @click="handleLogout">
- <view class="mlistl"><image :src="miconl" class="imgl"></image></view>
- <view class="mlistc">退出登录</view>
- </view>
- </view>
- </view>
- </view>
- <footers v-if="isfootflag" :footlist="footlist" :footerindex="footerindex" :color_checked="color_checked" :color_nochecked="color_nochecked" :isHomeIndex="true"></footers>
- <pop-up :type='type' :yycode="yy_code" :confdat='confdat' :teacherClass='teacherClass' :timetit="timetit" :timelist="timelist" @getClose="getClose" @getKeyFn="getKeyFn" @getConfirm="getConfirm" @getKeyNext="getKeyNext"></pop-up>
- </view>
- </template>
- <script>
- import popUp from "@/components/popup/popup.vue"
- import config from '@/config'
- const baseUrl = config.baseUrl
- import storage from '@/utils/storage'
- import footers from '@/components/footer/footer.vue'
- import {getConfigKey,getupdConfigKey,getDeptList,getselfList} from "@/api/mine/mine.js"
- import {getDictionaryFn} from '@/api/mine/register.js'
- import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
- import {getInfo } from '@/api/login'
- import QR from "@/utils/wxqrcode.js" // 二维码生成器
- export default {
- components:{
- popUp,footers
- },
- data() {
- return {
- footlist:[
- {module:'home',title:'首页',icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png'),},
- {module:'work',title:'课表',icon_checked:require('@/static/images/tabbar/work_.png'),icon_nochecked:require('@/static/images/tabbar/work.png'),limit:'course:table:list'},
- {module:'trends',title:'动态',icon_checked:require('@/static/images/tabbar/trends_.png'),icon_nochecked:require('@/static/images/tabbar/trends.png'),limit:'xiaoYuan:notice:list'},
- {module:'mine',title:'我的',icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
- ],
- footerindex:'mine',
- isfootflag:true,
- color_checked :'161616',
- color_nochecked :'666666',
- abg:require('@/static/images/index/habg.png'),
- noticimg:require('@/static/images/mnotic.png'),
- rimg:require('@/static/images/rimg.png'),
- wrimg:require('@/static/images/wrimg.png'),
- micona:require('@/static/images/micona.png'),
- miconb:require('@/static/images/miconb.png'),
- miconc:require('@/static/images/miconc.png'),
- micond:require('@/static/images/micond.png'),
- micone:require('@/static/images/micone.png'),
- miconf:require('@/static/images/miconf.png'),
- micong:require('@/static/images/micong.png'),
- miconh:require('@/static/images/miconh.png'),
- miconi:require('@/static/images/miconi.png'),
- miconj:require('@/static/images/miconj.png'),
- miconk:require('@/static/images/miconk.png'),
- miconl:require('@/static/images/miconl.png'),
- miconm:require('@/static/images/miconm.png'),
- miconn:require('@/static/images/miconn.png'),
- micono:require('@/static/images/micono.png'),
- miconp:require('@/static/images/miconp.png'),
- miconq:require('@/static/images/miconq.png'),
- miconr:require('@/static/images/miconr.png'),
- type:0,
- confdat:{tit:'系统提示',txt:"确定注销并退出系统吗?",closetxt:'取消',suretxt:'确认'},
- backgroundColor:"transparent",
- navborder:false,
- timetit:'',
- timelist:[],
- timetype:'',
- discipline:'',
- schoolName:'',
- schoolId:'',
- classId:'',
-
- teacherClass:[],
- roles:'',
- baseUrl:'',
- yy_code:'',
- name: this.$store.state.user.name,
- avatarimg:require("@/static/images/profile.png"),
- version: getApp().globalData.config.appInfo.version,
- codeurl:'https://xygl.cnzxy.cn'
- }
- },
- computed: {
- avatar() {
- return this.$store.state.user.avatar
- },
- choseroles() {
- return this.$store.state.user.choseroles
- },
- windowHeight() {
- return uni.getSystemInfoSync().windowHeight - 50
- }
- },
- onUnload(){
- uni.$off('refreshdatalis')
- },
- onPullDownRefresh:function(){
- this.init();
- this.getClassFn();
- setTimeout(function () {
- uni.stopPullDownRefresh();
- }, 1000);
- },
- onShow() {
- return
- var choseroles=this.$store.state.user.choseroles;
- if(this.roles&&choseroles&&this.roles!=choseroles){
- this.roles=choseroles;
- this.schoolName=this.$store.state.user.deptName
- // 当前人的角色
- if(uni.getStorageSync('checkclass')&&choseroles=='teacher'){
- var newobj=JSON.parse(JSON.stringify(uni.getStorageSync('checkclass')))
- this.discipline=newobj.discipline;
- this.schoolName=newobj.schoolName;
- this.schoolId=newobj.schoolId;
- this.classId=newobj.classId;
- }
- this.getClassFn()
- }
- },
- onLoad() {
- this.baseUrl=baseUrl;
- var choseroles=this.$store.state.user.choseroles;
- this.roles=choseroles;
- this.schoolName=this.$store.state.user.deptName
- // 当前人的角色
- if(uni.getStorageSync('checkclass')&&choseroles=='teacher'){
- var newobj=JSON.parse(JSON.stringify(uni.getStorageSync('checkclass')))
- this.discipline=newobj.discipline;
- this.schoolName=newobj.schoolName;
- this.schoolId=newobj.schoolId;
- this.classId=newobj.classId;
- }
- var url=this.codeurl+'/pages/order/come?id='+this.$store.state.user.tenantId;
- this.yy_code = QR.createQrCodeImg(url, {
- size: parseInt(240),//二维码大小
- typeNumber:10
- })
-
-
- uni.$on('refreshdatalis',(e) => {
- this.getClassFn();
- })
- this.init();
- this.getClassFn()
- },
- onPageScroll(e) {
- var scrollTop=Number(e.scrollTop);
- if(scrollTop>0){
- this.backgroundColor='#c4defb'
- }else{
- this.backgroundColor='transparent'
- }
- },
- methods: {
- checkPermi, checkRole,
- handleLogout() {
- this.type=1
- // this.$modal.confirm('确定注销并退出系统吗?').then(() => {
- // this.$store.dispatch('LogOut').then(() => {
- // this.$tab.reLaunch('/pages/index/index')
- // })
- // })
- },
- getConfirm(){
- this.$store.dispatch('LogOut').then(() => {
- this.$tab.reLaunch('/pages/index/index')
- })
- },
- init(){
- // 放学时间
- getDictionaryFn('sys_time').then(res=>{
- if(res.code==200){
- this.timelist = res.data.map(v => {
- return {
- dictLabel: v.dictLabel,
- dictValue: v.dictValue
- }
- })
- }
- })
- },
- getselfList(id){
- var params={
- parentId:id,
- }
- params['params[role]']=this.$store.state.user.choseroles
- getselfList(params).then(res=>{
- if(res.code==200){
- var newArr=res.data;
- if(newArr&&newArr.length){
- this.teacherClass = newArr.map(v => {
- return {
- dictLabel: v.deptName,
- dictValue: v.deptId
- }
- })
- }
- }else{
- this.$toast(res.msg)
- }
- })
- },
- getClassFn(){
- var that=this;
- var choseroles=this.$store.state.user.choseroles||'';
- var roles=choseroles;
- that.roles=roles;
- if(choseroles=='school'){
- that.classId='';
- that.schoolId=that.$store.state.user.deptId;
- this.getselfList(0)
- }else if(roles=='teacher'){
- var id=that.$store.state.user.schoolId;
- this.getselfList(id)
- }
- },
- // 班级
- getclassListFn(){
- getDeptList(this.schoolId).then(res=>{
- if(res.code==200){
- this.teacherClass = res.data.map(v => {
- return {
- dictLabel: v.deptName,
- dictValue:v.deptId
- }
- })
- }else{
- this.$toast(res.msg)
- }
- })
- },
- handleAuth(){
- var roles=this.$store.state.user.roles;
- if(roles.length>0){
- this.$tab.navigateTo('/mine/pages/mine/auth')
- }else{
- //当前只有一种身份
- this.$toast("您当前只有一种身份")
- // this.$tab.switchTab('/pages/index/index')
- }
- },
- handleaddAuth(){
- // this.$tab.navigateTo('/mine/pages/mine/auth?type=add')
- this.$tab.navigateTo('/mine/pages/mine/roles')
- },
- handleCollect(){
- this.$tab.navigateTo('/mine/pages/trends/mycollect')
- },
- handleToinfo(){
- this.$tab.navigateTo('/mine/pages/mine/exit')
- },
- handlePrivacy(){
- this.$tab.navigateTo(`/pages/agreement`)
- },
- handleUpassword(){
- this.$tab.navigateTo(`/pages/mine/pwd/index`)
- },
- handleSchool(){
- var id=this.$store.state.user.deptId
- this.$tab.navigateTo('/mine/pages/mine/applyregister?type=update&id='+id)
- // this.$tab.navigateTo('/mine/pages/mine/applyteacher')
- },
- handleWord(){
- this.$tab.navigateTo('/mine/pages/mine/word')
- },
- handleQuery(){
- this.$tab.navigateTo('/mine/pages/login/query?from=mine')
- },
- handleClass(){
- this.$tab.navigateTo('/mine/pages/mine/addclass')
- },
- handlelimit(){
- this.$tab.navigateTo('/mine/pages/mine/limit')
- },
- handleClassSet(){
- this.$tab.navigateTo('/mine/pages/mine/setclass')
- },
- handleaddStu(){
- this.$tab.navigateTo('/mine/pages/mine/setstuent')
- },
- handleTime(e){
- this.type=5;
- this.timetype=e;
- },
- getKeyNext(data){
- this.type=3;
- this.classId=data;
- this.getConfigKey(data)
- },
- handleInvite(){
- this.type=8;
- },
- handleZhaccount(){
- this.$tab.navigateTo('/work/pages/examine/zhaccount')
- },
- handleTkcourse(){
- this.$tab.navigateTo('/work/pages/examine/tkcourse')
- },
- handleToAvatar() {
- this.$tab.navigateTo('/pages/mine/avatar/index')
- },
- getKeyFn(data){
- var params={
- 'configKey':this.classId,
- 'configValue':data,
- "configType":this.timetype
- }
- getupdConfigKey(params).then(res=>{
- if(res.code==200){
- this.$toast('修改成功')
- this.type=0;
- }else{
- this.$toast(res.msg)
- }
- })
- },
- getClose(){
- this.type=0
- },
- getConfigKey(e){
- var params={
- configType:this.timetype,
- configKey:e
- }
- //班级id
- // configType "1:准备下课 2:延迟下课",
- getConfigKey(params).then(res=>{
- if(res.code==200){
- this.type=3
- this.timetit=res.msg||5;
- }else{
- this.$toast(res.msg)
- }
- })
- },
-
-
- handleToInfo() {
- this.$tab.navigateTo('/pages/mine/info/index')
- },
- handleToEditInfo() {
- this.$tab.navigateTo('/pages/mine/info/edit')
- },
- handleToSetting() {
- this.$tab.navigateTo('/pages/mine/setting/index')
- },
- handleToLogin() {
- this.$tab.reLaunch('/pages/login')
- },
-
- handleLogout() {
- this.$modal.confirm('确定注销并退出系统吗?').then(() => {
- this.$store.dispatch('LogOut').then(() => {
- this.$tab.reLaunch('/pages/index/index')
- })
- })
- },
- handleHelp() {
- this.$tab.navigateTo('/pages/mine/help/index')
- },
- handleAbout() {
- this.$tab.navigateTo('/pages/mine/about/index')
- },
- handleJiaoLiuQun() {
- this.$modal.showToast('QQ群:133713780')
- },
- handleBuilding() {
- this.$modal.showToast('模块建设中~')
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #f5f6f7;
- }
- .home_top /deep/ .uni-navbar__placeholder{height: 0 !important;}
- .abg{width: 100%;height: 622rpx;}
- .min_top{position: relative;width: 40rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;
- image{width: 32rpx;height: 32rpx;}
- .circ{width: 12rpx;height: 12rpx;background: #EB5663;border-radius: 50%;position: absolute;right: 4rpx;top: 4rpx;}
- }
- .header_top{padding: 34rpx 26rpx;
- .limg{width: 120rpx;height: 120rpx;border-radius: 50%;margin-right: 26rpx;}
- .rimg{width: 14rpx;height: 24rpx;margin-left: 26rpx;}
- .hcen{
- text{height: 34rpx;background: #89A8F6;border-radius: 16rpx;line-height: 34rpx;font-weight: normal;font-size: 24rpx;color: #ffffff;display: inline-block;min-width: 78rpx;padding: 0 10rpx;box-sizing: border-box;margin-left: 24rpx;}
- }
- }
- .bgf{
- .mlist{padding:30rpx 34rpx;
- .mlistl{width: 40rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 16rpx;
- .imga{width: 38rpx;height: 38rpx;}
- .imgb{width: 32rpx;height: 32rpx;}
- .imgc{width: 30rpx;height: 30rpx;}
- .imgd{width: 32rpx;height: 34rpx;}
- .imge{width: 32rpx;height: 26rpx;}
- .imgf{width: 32rpx;height: 30rpx;}
- .imgg{width: 34rpx;height: 34rpx;}
- .imgi{width: 34rpx;height: 34rpx;}
- .imgk{width: 32rpx;height: 30rpx;}
- }
- .mlistc{flex: 1;font-size: 32rpx;font-weight: 500;
- color: #161616;}
- .mlistr{width: 14rpx;height: 24rpx;marign-left:16rpx}
- }
- }
- .mnbox{
- background: #FFFFFF;border-radius: 18rpx;margin-bottom: 24rpx;padding: 40rpx 0 16rpx;
- .mn_tit{font-size: 32rpx;font-weight: bold;
- color: #161616;padding-left: 68rpx;position: relative;margin-bottom: 12rpx;
- &::before{width: 6rpx;background: #1f57e6;border-radius: 4rpx;position: absolute;left: 36rpx;top: 4rpx;content: '';bottom: 4rpx;}
- }
- .mn_list{display: flex;flex-wrap: wrap;
- .mlist{width: 25%;box-sizing: border-box;display: flex;flex-direction: column;align-items: center;padding: 26rpx 0;
- .mlistl{width: 50rpx;height: 50rpx;display: flex;align-items: center;justify-content: center;margin-bottom: 16rpx;
- .imga{width: 42rpx;height: 44rpx;}
- .imgb{width: 44rpx;height: 44rpx;}
- .imgc{width: 44rpx;height: 42rpx;}
- .imgd{width: 42rpx;height: 44rpx;}
- .imge{width: 44rpx;height: 42rpx;}
- .imgf{width: 32rpx;height: 30rpx;}
- .imgg{width: 44rpx;height: 44rpx;}
- .imgh{width: 40rpx;height: 44rpx;}
- .imgk{width: 40rpx;height: 42rpx;}
- .imgl{width: 46rpx;height: 46rpx;}
- }
- .mlistc{flex: 1;font-size: 30rpx;font-weight: 500;color: #666666;}
- }
- }
-
- }
- .mine-container {
- width: 100%;
- height: 100%;
- .header-section {
- padding: 15px 15px 45px 15px;
- color: white;
- .login-tip {
- font-size: 18px;
- margin-left: 10px;
- }
- .cu-avatar {
- border: 2px solid #eaeaea;
- .icon {
- font-size: 40px;
- }
- }
- .user-info {
- margin-left: 15px;
- .u_title {
- font-size: 18px;
- line-height: 30px;
- }
- }
- }
- .content-section {
- position: relative;
- top: -50px;
- .mine-actions {
- margin: 15px 15px;
- padding: 20px 0px;
- border-radius: 8px;
- background-color: white;
- .action-item {
- .icon {
- font-size: 28px;
- }
- .text {
- display: block;
- font-size: 13px;
- margin: 8px 0px;
- }
- }
- }
- }
- }
- </style>
|