浏览代码

Merge remote-tracking branch 'origin/2025鹅状元dev' into 2025鹅状元dev

# Conflicts:
#	pages/wordList/wordList.vue
wangxy 2 月之前
父节点
当前提交
5cb2c2c0e2
共有 2 个文件被更改,包括 39 次插入34 次删除
  1. 1 1
      common/styles/global/pages.scss
  2. 38 33
      pages/wordList/wordList.vue

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

@@ -1933,7 +1933,7 @@
 		flex-shrink: 0;margin: 0 2%;width: 96%;
 		line-height: 1.4;box-sizing: border-box;border-bottom: 1rpx dashed #068aea;
 		.uni-scroll-view-content{display: flex;}
-		.title-item{margin: 0 16rpx;color: #068aea;font-size: 28rpx;position: relative;padding: 12rpx 0;}
+		.title-item{margin: 0 18rpx;color: #068aea;font-size: 28rpx;position: relative;padding: 12rpx 24rpx;}
 		.title-item.active{font-weight: bold;}
 		.title-item.active::after{content: '';width: 70%;height: 8rpx;display: block;
 		background-color:#068aea;bottom: 0rpx;left:15%;position: absolute;border-radius: 8rpx;}

+ 38 - 33
pages/wordList/wordList.vue

@@ -52,34 +52,22 @@
 			</view>
 		</view>
 		<tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :imgShow="true"></tip-big-dialog>
+		<tip-small-dialog ref="goPayDialogRef" @confirm-btn="goPayPage" :content="tipContent"></tip-small-dialog>
 	</view>
 </template>
 
 <script setup>
-	import {
-		reactive,
-		ref,
-		nextTick
-	} from "vue";
-	import {
-		toast,
-		getDataFromStr
-	} from "@/utils/common";
-	import {
-		onLoad
-	} from "@dcloudio/uni-app";
-	import {
-		getWordZhangList,
-		getWordZhangListYK,
-	} from "@/api/word.js";
+	import {reactive,ref,nextTick} from "vue";
+	import {toast,getDataFromStr} from "@/utils/common";
+	import {onLoad} from "@dcloudio/uni-app";
+	import {getWordZhangList,getWordZhangListYK,} from "@/api/word.js";
 	import cacheManager from '@/utils/cacheManager.js';
 	import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
-	import {
-		useSwiper
-	} from "@/utils/useSwiper";
-
+	import {useSwiper} from "@/utils/useSwiper";
+	import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
 
 
+	const goPayDialogRef = ref(null);
 	const listData = reactive({
 		jieNumberList: [], //节名称
 		title: '', // 版本+年级+学期
@@ -95,15 +83,23 @@
 		levelId: null,
 		zhangId: null,
 	})
+	const tipContent = '是否前往开通付费?';
 
 	const {
 		swiperData,
 		handleTouchStart,
 		handleTouchEnd,
-      userCode
+		userCode
 	} = useSwiper(listData, (userCode) => {
 		console.log('userCode',userCode)
-
+		// 非VIP
+		if (userCode.value == 'Not-Vip') {
+			goPayDialogRef.value.handleShow();
+		}else if(userCode.value == 'Visitor'){
+			// 游客
+			youkeDialogRef.value.handleShow();
+		}
+		
 	});
 
 	onLoad((options) => {
@@ -120,7 +116,6 @@
 			[info.levelId, info.zhangId] = getDataFromStr(cacheManager.get('auth').levelId)
 			// 非游客
 			wordJieId = routerOpt.jieId
-			console.log(wordJieId,'routerOpt.jieId');
 			getWordListData();
 		}
 	});
@@ -133,12 +128,12 @@
 			});
 			swiperData.isAllowed = false; // 重置状态
 		}
-    if (userCode.value == 'VIP') {
-      listData.activeIndex = e.detail.current;
-      // unit滚动到指定位置
-      handleTitleClick(listData.jieNumberList[listData.activeIndex])
-    }
-    findWordLeft(listData.activeIndex)
+		if (userCode.value == 'VIP') {
+			console.log('VIPVIPVIP');
+		  listData.activeIndex = e.detail.current;
+		  handleTitleClick(listData.jieNumberList[listData.activeIndex])
+		}
+		findWordLeft(listData.activeIndex)
 	}
 
 
@@ -174,7 +169,6 @@
 	}
 
 	function handleTitleClick(item) {
-		console.log(item,'item');
 		if (!cacheManager.get('auth')) {
 			youkeDialogRef.value.handleShow();
 		} else {
@@ -195,13 +189,11 @@
 
 	// 获取滚动距离
 	function findWordLeft(data) {
-    console.log('data',data);
-		wordLeft.value = data * 40;
+		wordLeft.value = data * 80;
 		return wordLeft.value;
 	}
 
 	function getWordListData() {
-		console.log('wordJieId.value',wordJieId.value);
 		const opt = {
 			levelId: info.levelId,
 			zhangId: info.zhangId,
@@ -261,4 +253,17 @@
 			})
 		}
 	}
+
+	// 去支付
+	function goPayPage() {
+		let zhangInfoLocal = cacheManager.get('zhangInfo')
+		if (!zhangInfoLocal.cardId) {
+			toast("cardId 丢失请重新选择学科LevelId");
+			return false
+		}
+		uni.redirectTo({
+			url: '/pages/mall/mallPage?cardId=' + zhangInfoLocal.cardId + '&from=daoPage' + '&subjectId=' +
+				zhangInfoLocal.subjectId
+		})
+	}
 </script>