wangxy 1 month ago
parent
commit
3c3597b1e6
1 changed files with 27 additions and 11 deletions
  1. 27 11
      pages/chanpinneirong/index2.vue

+ 27 - 11
pages/chanpinneirong/index2.vue

@@ -30,18 +30,33 @@
 			</view>
 			<view class="xx-item-list">
 				<view class="xx-item-title cccAAA2">— 以下为当前等级课程目录 —</view>
+
+        <template v-if="unitPositions.length">
+          <ezyActiveVue  class="ezy-list-item-active item-dy-box item-fixed cccAAA"
+                         @aclick="handleClickDanyuan(danyuanList[activeAAAIndex])" :id="`unit-title-${danyuanList[activeAAAIndex].danyuanId}`">
+            <view class="dy-left-box">L{{banbenInfo.dengjiId}}</view>
+            <view class="dy-right-box">
+              <view class="right-content">
+                <view class="dy-name">{{danyuanList[activeAAAIndex].danyuanName}}</view>
+                <view>{{danyuanList[activeAAAIndex].danyuanIntro}}</view>
+              </view>
+            </view>
+          </ezyActiveVue>
+        </template>
+
+
 				<view v-for="(danyuanItem,index) in danyuanList" :key="danyuanItem.danyuanId">
 					<!-- 第一单元 -->
-					<ezyActiveVue v-if="index ==0" class="ezy-list-item-active item-dy-box item-fixed cccAAA"
-						@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">
-								<view class="dy-name">{{danyuanItem.danyuanName}}</view>
-								<view>{{danyuanItem.danyuanIntro}}</view>
-							</view>
-						</view>
-					</ezyActiveVue>
+            <ezyActiveVue v-show="false"  v-if="index ==0" class="ezy-list-item-active item-dy-box item-fixed cccAAA"
+                          @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">
+                  <view class="dy-name">{{danyuanItem.danyuanName}}</view>
+                  <view>{{danyuanItem.danyuanIntro}}</view>
+                </view>
+              </view>
+            </ezyActiveVue>
 					<!-- 其他单元 -->
 					<view v-if="index !=0" class="xx-item-title cccAAA" :id="`unit-title-${danyuanItem.danyuanId}`">—
 						{{danyuanItem.danyuanName}}
@@ -111,7 +126,7 @@
 				unitPositions: [],
 				// 节流定时器
 				throttleTimer: null,
-				activeAAAIndex: null,	
+				activeAAAIndex: 0,
 				defaultD: 0,
 				//-------------- end ---------------/ 
 
@@ -440,6 +455,7 @@
 					.in(this)
 					.selectAll(".cccAAA")
 					.boundingClientRect((rects) => {
+            console.log('cccAAA', rects)
 						this.unitPositions = [...rects]
 						this.defaultD = rects[0].top;
 					})