浏览代码

空的效果展示

tanxue 2 月之前
父节点
当前提交
4d379408b1
共有 2 个文件被更改,包括 12 次插入7 次删除
  1. 1 0
      common/styles/global/pages.scss
  2. 11 7
      pages/wordList/wordList.vue

+ 1 - 0
common/styles/global/pages.scss

@@ -1939,6 +1939,7 @@
 		background-color:#068aea;bottom: 0rpx;left:15%;position: absolute;border-radius: 8rpx;}
 	}
 	.word-list-body{flex: 1;overflow-y: auto;box-sizing: border-box;padding: 0 24rpx;}
+	.no-word-box{font-size: 28rpx;color: #666;flex: 1;display: flex;align-items: center;justify-content: center;}
 	.word-num-box{
 		display: flex;align-items: center;padding: 20rpx 24rpx;box-sizing: border-box;
 		icon{width: 10rpx;height: 32rpx;background-color:#068aea;border-radius:4rpx;margin-right: 8rpx;}

+ 11 - 7
pages/wordList/wordList.vue

@@ -18,9 +18,11 @@
 					<swiper-item class="word-list-swiper-item" v-for="citem in unitList" :key="citem.jieId" @touchstart="handleTouchStart"
 						@touchend="handleTouchEnd">
 						<view class="word-list-body" v-if="citem.wordList && citem.wordList.length > 0">
+							<!-- num -->
 							<view class="word-num-box">
 								<icon></icon><text>{{citem.studyCount || 0}}/{{citem.count || 0}}词</text>
 							</view>
+							
 							<!-- 单词 -->
 							<view class="word-list-item" v-for="(item,index) in citem.wordList" :key="index"
 								@click="toWord(item)" :class="{active: item.wcFlag == 1}">
@@ -44,6 +46,10 @@
 								</view>
 							</view>
 						</view>
+						<!-- 没有单词 -->
+						<view class="no-word-box" v-else>
+							暂无单词
+						</view>
 					</swiper-item>
 				</swiper>
 
@@ -91,11 +97,10 @@
 		handleTouchEnd,
 		userCode
 	} = useSwiper(listData, (userCode) => {
-		console.log('userCode',userCode)
 		// 非VIP
-		if (userCode.value == 'Not-Vip') {
+		if (userCode == 'Not-Vip') {
 			goPayDialogRef.value.handleShow();
-		}else if(userCode.value == 'Visitor'){
+		}else if(userCode == 'Visitor'){
 			// 游客
 			youkeDialogRef.value.handleShow();
 		}
@@ -121,6 +126,7 @@
 	});
 
 	function handleSwiperChange(e) {
+		listData.activeIndex = e.detail.current;
 		if (!swiperData.isAllowed) {
 			// 不满足条件时回退到原索引
 			nextTick(() => {
@@ -128,12 +134,10 @@
 			});
 			swiperData.isAllowed = false; // 重置状态
 		}
-		if (userCode.value == 'VIP') {
-			console.log('VIPVIPVIP');
-		  listData.activeIndex = e.detail.current;
+		if (userCode == 'VIP') {
+		  findWordLeft(listData.activeIndex)
 		  handleTitleClick(listData.jieNumberList[listData.activeIndex])
 		}
-		findWordLeft(listData.activeIndex)
 	}