From c043408e68c978e84fb966a703782704da08b44b Mon Sep 17 00:00:00 2001 From: liuyuan Date: Wed, 8 Jan 2025 15:46:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B91.07=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=AD=90=E7=9B=AE=E5=BD=95=E8=B7=B3=E8=BD=AC=E5=90=8E=E5=9B=9E?= =?UTF-8?q?=E6=9D=A5=E6=B2=A1=E6=9C=89=E5=9B=BA=E5=AE=9A=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 16 -------- pages/course/index.vue | 5 ++- pages/peanut/home.vue | 41 ++++++++++++------- .../components/z-nav-bar/z-nav-bar.vue | 1 + 4 files changed, 31 insertions(+), 32 deletions(-) diff --git a/pages.json b/pages.json index 1f80f4e..981a50e 100644 --- a/pages.json +++ b/pages.json @@ -778,12 +778,6 @@ "selectedIconPath": "static/tab/icon1_y.png", "text": "首页" }, - // { - // "pagePath": "pages/peanut/shopping", - // "iconPath": "static/tab/tab_nor_02.png", - // "selectedIconPath": "static/tab/tab_cur_02.png", - // "text": "购物车" - // }, { "pagePath": "pages/bookShop/orderList", "iconPath": "static/tab/order.png", @@ -803,15 +797,5 @@ "text": "我的" } ] - }, - "condition": { //模式配置,仅开发期间生效 - "current": 0, //当前激活的模式(list 的索引项) - "list": [ - { - "name": "", //模式名称 - "path": "", //启动页面,必选 - "query": "" //启动参数,在页面的onLoad函数里面得到 - } - ] } } \ No newline at end of file diff --git a/pages/course/index.vue b/pages/course/index.vue index 189ce51..97f63ff 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -2,7 +2,7 @@ - 课程说明 + 课程说明 - {{ item.title }} @@ -332,7 +332,6 @@ return { myList: [], advertisementList: [], - showEbook: false, // 显示电子书相关 transaction: { // 成功回调 @@ -374,6 +373,10 @@ timeDif: {}, showCountDown: false, classId: undefined, + //下标 + currentIndex: 0, + currentIndex: null, + fixed: null }; }, onPageScroll(e) { @@ -389,9 +392,21 @@ }, onHide() { this.page = 1; + uni.removeStorageSync('fixed'); }, //页面显示 async onShow() { + //存储的需要固定分类 + this.fixed = uni.getStorageSync('fixed'); + + //固定分类 + if(this.fixed){ + this.curseClick(this.currentItem,this.currentIndex); + }else{ + console.log('我是else11111') + this.currentIndex = 0; + this.currentItem = null; + } uni.hideTabBar(); // #ifdef APP-PLUS // plus.screen.unlockOrientation(); @@ -420,9 +435,7 @@ this.examId = undefined; paperEndTime = 0; } - console.log("this.examId////////////", paperEndTime); - // severNowTime = await this.getServerTime() - // console.log('//////////////', paperEndTime, severNowTime); + if (severNowTime > -1 && paperEndTime - severNowTime > 0) { var secondTimeDif = paperEndTime - severNowTime; this.timeDif.hour = parseInt( @@ -433,7 +446,6 @@ ); this.timeDif.second = (secondTimeDif % (1000 * 60)) / 1000; this.showCountDown = true; - console.log("时间符合吗?", this.showCountDown, secondTimeDif); } else { this.showCountDown = false; } @@ -507,8 +519,6 @@ var startTime = startTimeDate.getTime(); var step = 1000 * 60 * 60 * e; // 时间间隔 var interval = startTime + step; //开始 + 时长 = 结束的毫秒数 - // var a = new Date(interval) - console.log("aaaaaaaaaa结束时间的毫秒数,时间戳", interval); return interval; }, // 继续考试 @@ -599,7 +609,6 @@ return _list; }, goGoodsDetail(v, isMiaosha) { - console.log(v); uni.navigateTo({ url: `/pages/goods/index/index?navTitle=${v.title}&isMiaosha=${isMiaosha}&title=${v.title}&id=${v.productId}`, }); @@ -634,15 +643,16 @@ if (res && res.code == 0) { if (res.labels.length > 0) { this.curseTagList = res.labels; - this.tabsid = res.labels[0].id; - // this.curseClick(res.labels[0]) + //按currentIndex同步显示 + this.tabsid = res.labels[this.currentIndex].id; if (res.labels[0].isLast == 0) { // 非终极 if ( res.labels[0].children && res.labels[0].children.length > 0 ) { - this.sbuMedicalTagsList = res.labels[0].children; + //数据按currentIndex同步显示 + this.sbuMedicalTagsList = res.labels[this.currentIndex].children; } else { this.sbuMedicalTagsList = []; } @@ -703,7 +713,6 @@ if (res.code == 0) { if (res.result.records.length > 0) { this.seckillList = res.result.records; - console.log(this.seckillList, '111111111111111ss') } else { this.seckillList = []; } @@ -799,8 +808,11 @@ window.open(url); // #endif }, - curseClick(item) { + curseClick(item,index) { this.tabsid = item.id; + //记录被选中的item和index + this.currentItem = item; + this.currentIndex = index; if (item.isLast == 0) { // 终极 if (item.children && item.children.length > 0) { @@ -816,7 +828,6 @@ }, curseClickJump(item) { uni.navigateTo({ - // url: `/pages/course/index?id=${item.id}&title=中医学` url: `/pages/course/index?id=${item.id}&title=${item.title}&pid=${item.pid}`, }); }, diff --git a/uni_modules/z-nav-bar/components/z-nav-bar/z-nav-bar.vue b/uni_modules/z-nav-bar/components/z-nav-bar/z-nav-bar.vue index 7f11c11..05bfa9d 100644 --- a/uni_modules/z-nav-bar/components/z-nav-bar/z-nav-bar.vue +++ b/uni_modules/z-nav-bar/components/z-nav-bar/z-nav-bar.vue @@ -416,6 +416,7 @@ export default { if (this.backState == 3000) { this.$emit("backClick"); } else { + this.$emit('back'); uni.navigateBack(); } },