Browse Source

调整章节

wangxy 3 months ago
parent
commit
66820fc5b6
3 changed files with 22 additions and 11 deletions
  1. 3 3
      components/catalogue/catalogue.vue
  2. 18 7
      pages/study/index.vue
  3. 1 1
      utils/constant.js

+ 3 - 3
components/catalogue/catalogue.vue

@@ -113,9 +113,9 @@
 	
 	function handleJieClick(item,jie,index,cindex) {
 		selectZhang.value = item;
-		if (index == 0 && cindex == 0 ) {
+		if (index == 0) {
 			// 全员可访问 第一章 第一节
-			this.$emit('listSelectJieClick', item,jie);
+			this.$emit('listSelectJieClick', item,jie,cindex);
 			return;
 		}
 		if (AuthCode.value == 'Visitor') {
@@ -130,7 +130,7 @@
 		}
 		
 		// Vip
-		this.$emit('listSelectJieClick', item,jie);
+		this.$emit('listSelectJieClick', item,jie, cindex);
 	}
 
 	function catalogueBjFun(){

+ 18 - 7
pages/study/index.vue

@@ -108,14 +108,25 @@
 		init(options);
 	})
 	
-	function listSelectJieClick(item,jie) {
-		if( cacheManager.get('auth')){
-			cacheManager.updateObject('auth', {
-				currentZhang: zhangList.value.findIndex(citem => citem.zhangId == item.zhangId),
-				zhangId: item.zhangId
-			})
+	function listSelectJieClick(item,data,index) {
+		
+		if ((!cacheManager.get('auth') && item.number != 1)||(!cacheManager.get('auth') && data.type == 2) ) {
+			youkeDialogRef.value.handleShow();
+			return;
+		}
+		const authCode = getUserIdentity();
+		if (!(authCode == 'VIP' || item.number == 1)) {
+		//	debugger
+			goPayDialogRef.value.handleShow();
+			return false
+		}
+		
+		if (data.type == 2) {
+			// 最后一项
+			goKaoshi(data,index)
+		} else {
+			goLookShipin(data,index)
 		}
-		listClick(jie);
 	}
 	
 	function getProjectImg(){

+ 1 - 1
utils/constant.js

@@ -40,7 +40,7 @@ export const xueke_list = [
 	}
 ]
 
-export const MESSAGE_BEFORE_PAY = `当前为非会员模式请先购买!`;
+export const MESSAGE_BEFORE_PAY = `付费章节,是否前往开通付费?`;
 export const MESSAGE_VISITER_TO_LOGIN = `您当前的身份是游客,想要体验完整内容需注册成用户!`;