From c181c130480aa28ef7893dd75572a237ac7ee48e Mon Sep 17 00:00:00 2001 From: daihh Date: Mon, 20 Jun 2022 17:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/coursePortal.js | 2 +- src/layout/components/TopNav/Index.vue | 102 ++++++++++--------------- src/utils/constants.js | 3 +- src/views/Loading.vue | 1 + src/views/Login.vue | 1 + 5 files changed, 44 insertions(+), 65 deletions(-) diff --git a/src/api/modules/coursePortal.js b/src/api/modules/coursePortal.js index bc94d3ba..8e514d9b 100644 --- a/src/api/modules/coursePortal.js +++ b/src/api/modules/coursePortal.js @@ -5,7 +5,7 @@ import ajax from '@/utils/xajax.js' /** - * 查询指定条数的课程,用于首页提取 + * post 请求 查询指定条数的课程,用于首页提取 * @param {Object} query * num:多少条记录 * orderType:排序方式,1表最新,3表最热 diff --git a/src/layout/components/TopNav/Index.vue b/src/layout/components/TopNav/Index.vue index 5101f2eb..855b9528 100644 --- a/src/layout/components/TopNav/Index.vue +++ b/src/layout/components/TopNav/Index.vue @@ -79,32 +79,15 @@ 提交修改 - - -
- - +
@@ -118,17 +101,13 @@ export default { return { checked:true, signInShow: false, + signLocalTimesKey:'xboe_sign_dlg_times', keyword: '', findType: '1', mouseIndex: 0, activeIndex: '', - oneSignIn:'boe_new', - msg: { - num: 0 - }, - user: { - name: '' - }, + msg: { num: 0 }, + user: { name: '' }, pwdDlg: { show: false, newPwd: '', nowPwd: '', rePwd: '' }, current:1 }; @@ -146,41 +125,36 @@ export default { } }, mounted() { - if(this.getCookies() == null) { - this.signInShow = true; + //控制弹出窗口的代码 + let now = new Date() //当前时间 + let end = new Date('2022/06/29 00:00:00') //对比时间 + if(now.getTime() < end.getTime()){ + let times = localStorage.getItem(this.signLocalTimesKey); + //let isNewLogin=localStorage.getItem(this.$Constants.newLoginKey); + let isNewLogin='1'; + if(isNewLogin && isNewLogin=='1'){ + if(!times){ + this.signInShow = true;//显示 + localStorage.setItem(this.signLocalTimesKey,1); + }else{ + console.log(times,'times'); + let intTimes=parseInt(times); + if(intTimes<4){ + this.signInShow = true;//显示 + intTimes++; + localStorage.setItem(this.signLocalTimesKey,intTimes); + } + } + localStorage.setItem(this.$Constants.newLoginKey,0); + } + } this.$store.dispatch('refrashMsg'); }, methods: { - getCookies() { - return Cookies.get(this.oneSignIn) + closeSignDlg(){ + this.signInShow=false; }, - setCookies(token,expiresTime) { - //console.log(token,expiresTime,'token,expiresTime'); - return Cookies.set(this.oneSignIn, token,expiresTime) - }, - removeCookies(){ - return Cookies.remove(this.oneSignIn) - }, - toExperience() { - this.signInShow = false; - if(this.checked) { - this.setCookies('new',60*60*24) - } else { - this.removeCookies(); - } - }, - // searchJump() { - // if(this.findType == '1') {// 课程 - // window.open(`/course?keyword=${this.keyword}`); - // } else if(this.findType == '2'){ // 案例 - // window.open(`/case?keyword=${this.keyword}`); - // } else if(this.findType == '3'){ //文章 - // window.open(`/article?keyword=${this.keyword}`); - // } else if(this.findType == '4'){ // 问答 - // window.open(`/qa?keyword=${this.keyword}`); - // } - // }, handleCommand(val) { let obj = { one: process.env.VUE_APP_BOE_WEB_URL+'/web/teacherLesson', @@ -238,6 +212,8 @@ export default {