From 41d03fb4ce4b3db3141ec87be40209f1893c7533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=8B=E4=BA=8E=E5=88=9D=E8=A7=81?= <752204717@qq.com> Date: Tue, 2 Jul 2024 11:26:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/commonComponents/anchorLink.vue | 92 +- .../component/commonComponents/curriculum.vue | 2 +- .../commonComponents/video/index.vue | 1919 +++++++++-------- pages/courseInformation/index/index.vue | 86 +- pages/curriculum/cate/index.vue | 12 +- pages/curriculum/order/curriculum/index.vue | 1 + pages/curriculum/order/index/index.vue | 39 +- unpackage/dist/dev/app-plus/app-service.js | 448 ++-- unpackage/dist/dev/app-plus/app-view.js | 314 ++- .../pages/component/cover-view/cover-view.js | 4 +- .../app-plus/pages/component/input/input.js | 4 +- .../dev/app-plus/pages/component/map/map.js | 4 +- .../app-plus/pages/component/video/video.js | 4 +- .../dev/app-plus/pages/tabBar/extUI/extUI.js | 4 +- .../pages/tabBar/template/template.js | 4 +- 15 files changed, 1603 insertions(+), 1334 deletions(-) diff --git a/pages/component/commonComponents/anchorLink.vue b/pages/component/commonComponents/anchorLink.vue index 46cbaa4..f124956 100644 --- a/pages/component/commonComponents/anchorLink.vue +++ b/pages/component/commonComponents/anchorLink.vue @@ -11,9 +11,24 @@ }" > - - + + {{ v.title }} + + + + + - + --> @@ -59,10 +74,11 @@ @@ -83,6 +99,8 @@ export default { "titleStyle", "baseHeight", "allTabList", + "slotName", + "defaultShowTabs", ], data() { return { @@ -111,8 +129,8 @@ export default { show: false, options: {}, - showTabs: false, // 默认吸顶的tab不显示 - currentTab: -1, // 由于初始化的uview的代码有bug,所以默认是-1,在第一次显示的时候,设置0,自动复位,防止错误 + showTabs: this.defaultShowTabs ? this.defaultShowTabs : false, // 默认吸顶的tab不显示 + currentTab: 0, // 由于初始化的uview的代码有bug,所以默认是-1,在第一次显示的时候,设置0,自动复位,防止错误 distanceArr: [], // 每一个ID对应的scrollTop值 @@ -132,7 +150,13 @@ export default { async onLoad(options) { this.options = options; - await this.handleselectCate({ ...this.cateList[0], index: 0 }, 0); + await this.handleselectCate( + { + ...this.cateList[0], + index: 0, + }, + 0 + ); }, async onShow() {}, methods: { @@ -140,10 +164,9 @@ export default { // console.log("event at line 213:", event); // const _this = this; if (this.isTabChange) { - return; + return false; } const scrollTop = event.scrollTop; - console.log("scrollTop at line 145:", scrollTop); const skewY = Number(this.baseHeight) + 45 + +Number(this.statusBarHeight); // 偏移量,由于吸顶的tab、头部的显示信息也有高度,素以做了偏移量 // // console.log('skewY at line 130:',this.baseHeight,this.statusBarHeight, skewY) @@ -156,17 +179,19 @@ export default { // console.log('this.showTabs at line 141:', this.showTabs) this.$nextTick(() => { - // const length = this.distanceArr.length; - // const index = this.distanceArr.findIndex( - // (el) => el.top - skewY - scrollTop - 40 > 0 - // ); console.log('index at line 15911111111111111:', index) - // // 当index == -1 的时候,实际当前滚动的距离超出了最大值,也就是在最后一个tab显示的内容 - // // 当index > 0 的时候,说明能在当前的scrollTop值找到,即index的前一位 - // this.currentTab = index > 0 ? index - 1 : length - 1; + // this.currentTab = null; + const length = this.distanceArr.length; + const index = this.distanceArr.findIndex( + (el) => el.top - skewY - scrollTop - 40 > 0 + ); + // console.log('index at line 15911111111111111:', index) + // 当index == -1 的时候,实际当前滚动的距离超出了最大值,也就是在最后一个tab显示的内容 + // 当index > 0 的时候,说明能在当前的scrollTop值找到,即index的前一位 + this.currentTab = index > 0 ? index - 1 : length - 1; }); this.$forceUpdate(); } else { - this.showTabs = false; + this.showTabs = this.defaultShowTabs ? this.defaultShowTabs : false; this.currentTab = 0; } }, @@ -271,7 +296,7 @@ export default { this.isTabChange = true; this.$nextTick(() => { - this.currentTab = item.index; + this.currentTab = index; var data = this.distanceArr.find((e) => e.title == item.title); console.log( "111111111111111111111111111111111111111at line 258:", @@ -280,12 +305,12 @@ export default { uni.pageScrollTo({ // duration: 100, //过渡时间 scrollTop: data.top - skewY, //到达距离顶部的top值 - duration: 100, + duration: 300, complete: function () { const timer = setTimeout(() => { that.isTabChange = false; // 关闭 clearTimeout(timer); - }, 500); // 解决ios和安卓、鸿蒙系统兼容性问题 + }, 1000); // 解决ios和安卓、鸿蒙系统兼容性问题 }, //scrollTop:data.top - res.top,//如果置顶 }); @@ -333,22 +358,27 @@ export default { position: absolute; min-height: 60vh; + .header { height: 100rpx; background: orange; + .bg { width: 100vw; height: 200rpx; } } + .tabs { position: fixed !important; z-index: 970; // top: 0; background-color: #fff; width: 100vw; + .tabsStyle { box-shadow: 0 2rpx 6rpx 0 rgba(153, 153, 153, 0.2); + ::v-deep { .u-tabs { box-shadow: 0px 4px 6px 0 rgba(153, 153, 153, 0.2); @@ -356,16 +386,19 @@ export default { } } } + .section { width: 100%; padding: 0 0rpx; box-sizing: border-box; + .section_top { width: 100%; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; + .title { font-size: 40rpx; font-family: PingFangSC-Semibold, PingFang SC; @@ -373,6 +406,7 @@ export default { color: #333333; margin-left: 30rpx; position: relative; + &::before { position: absolute; content: ""; @@ -660,5 +694,21 @@ export default { .hot { color: #00bb84 !important; + font-weight: bold; +} + +.wrapper_tab { + width: 100%; + display: flex; + align-items: center; + justify-content: space-around; + font-size: 34rpx; +} + +.wrapper_tab_item { + width: auto; + display: inline-block; + line-height: 60rpx; + padding: 10rpx 20rpx; } diff --git a/pages/component/commonComponents/curriculum.vue b/pages/component/commonComponents/curriculum.vue index 04e3dd0..8c8cf66 100644 --- a/pages/component/commonComponents/curriculum.vue +++ b/pages/component/commonComponents/curriculum.vue @@ -6,7 +6,7 @@ - + diff --git a/pages/component/commonComponents/video/index.vue b/pages/component/commonComponents/video/index.vue index 6992577..3f49634 100644 --- a/pages/component/commonComponents/video/index.vue +++ b/pages/component/commonComponents/video/index.vue @@ -1,6 +1,6 @@ \ No newline at end of file +#rotating-div { + width: 100vw; + height: 100vh; + background-color: #3498db; + transform: rotate(90deg); + /* 旋转90度 */ + transform-origin: center center; + /* 设置旋转中心点在div中心 */ + position: fixed; + /* 固定定位,全屏显示 */ + left: 0; + top: 0; + bottom: 0; + right: 0; +} + diff --git a/pages/courseInformation/index/index.vue b/pages/courseInformation/index/index.vue index d34dfbb..ede4d34 100644 --- a/pages/courseInformation/index/index.vue +++ b/pages/courseInformation/index/index.vue @@ -7,9 +7,11 @@ - - + + + + + @@ -113,6 +130,7 @@ export default { data() { return { currentTab: "", + dataInfo: {}, allDataList: [], playData: {}, searchValue: "", @@ -140,6 +158,24 @@ export default { limitTitle: "提示", limitContent: "", scrollViewHeight: 0, + detailDataList: [ + { + title: "购买须知", + valueName: "buyRecord", + }, + { + title: "使用须知", + valueName: "useRecord", + }, + { + title: "学习次序", + valueName: "studyRecord", + }, + { + title: "超v", + valueName: "vipRecord", + }, + ], }; }, // 监听页面滚动 @@ -406,32 +442,14 @@ export default { }; }); } else { - this.allDataList = [ - { - title: "购买须知", - valueName: "buyRecord", - url: "/pages/curriculum/cate/index", - content: res.result.buyRecord, - }, - { - title: "使用须知", - valueName: "useRecord", - url: "/pages/curriculum/cate/index", - content: res.result.useRecord, - }, - { - title: "学习次序", - valueName: "studyRecord", - url: "/pages/curriculum/cate/index", - content: res.result.studyRecord, - }, - { - title: "超v", - valueName: "vipRecord", - url: "/pages/curriculum/cate/index", - content: res.result.vipRecord, - }, - ]; + that.dataInfo = { ...res.result }; + that.allDataList = that.detailDataList.map((e) => { + return { + ...e, + content: res.result[e.valueName], + slotName: e.valueName, + }; + }); console.log("this.allDataList at line 405:", this.allDataList); } diff --git a/pages/curriculum/cate/index.vue b/pages/curriculum/cate/index.vue index 3963756..2a9ffe6 100644 --- a/pages/curriculum/cate/index.vue +++ b/pages/curriculum/cate/index.vue @@ -4,16 +4,16 @@ --> +