Browse Source

增加吸顶效果

tanxue 1 month ago
parent
commit
7c1b378b77
2 changed files with 6 additions and 6 deletions
  1. 2 2
      common/styles/global/pages.scss
  2. 4 4
      pages/chanpinneirong/index.vue

+ 2 - 2
common/styles/global/pages.scss

@@ -2120,11 +2120,11 @@
 				.dy-name{font-size: 34rpx;margin-bottom: 6rpx;}
 			}
 		}
-		/* .item-fixed{
+		.item-fixed{
 			width: 100%;padding: 24rpx 0;
 			position:sticky;position:-webkit-sticky;
 			top: 0;z-index: 10;background-color: #fff;
-		} */
+		}
 		/* 动画类 */
 		/* .item-dy-box.item-active {
 			animation: scalePulse 1s ease-in-out;

+ 4 - 4
pages/chanpinneirong/index.vue

@@ -30,8 +30,8 @@
 					<view class="xx-item-list">
 						<view class="xx-item-title">— 以下为当前等级课程目录 —</view>
 						<view v-for="(danyuanItem,index) in danyuanList" :key="danyuanItem.danyuanId">
-							<!-- 第一单元 v-if="index ==0"-->
-								<ezyActiveVue class="ezy-list-item-active item-dy-box" @aclick="handleClickDanyuan(danyuanItem)" :id="`unit-title-${danyuanItem.danyuanId}`">
+							<!-- 第一单元 -->
+								<ezyActiveVue v-if="index ==0" class="ezy-list-item-active item-dy-box item-fixed" @aclick="handleClickDanyuan(danyuanItem)" :id="`unit-title-${danyuanItem.danyuanId}`">
 									<view class="dy-left-box">L{{banbenInfo.dengjiId}}</view>
 									<view class="dy-right-box">
 										<view class="right-content">
@@ -41,9 +41,9 @@
 									</view>
 								</ezyActiveVue>
 							<!-- 其他单元 -->
-							<!-- <view v-if="index !=0" class="xx-item-title" :id="`unit-title-${danyuanItem.danyuanId}`">— {{danyuanItem.danyuanName}}
+							<view v-if="index !=0" class="xx-item-title" :id="`unit-title-${danyuanItem.danyuanId}`">— {{danyuanItem.danyuanName}}
 								{{danyuanItem.danyuanIntro}} —
-							</view> -->
+							</view>
 						
 
 							<ezyActiveVue class="ezy-list-item-active xx-item-box" v-for="jieItem in danyuanItem.jieList" :key="jieItem.jieId"