wangguoyu 5 months ago
parent
commit
999bbd08a7

+ 8 - 5
components/custom-tabbar/custom-tabbar.vue

@@ -11,13 +11,10 @@
 	import {
 		useTabBarHistory
 	} from '@/utils/emitEvents.js';
-	import {
-		toast
-	} from '@/utils/common'
 	import cacheManager from "@/utils/cacheManager.js";
 	import {
-		getUserIdentity
-	} from "@/utils/common.js"
+		toast,getUserIdentity
+	} from "@/utils/common";
 	export default {
 
 		data() {
@@ -53,6 +50,12 @@
 		methods: {
 
 			switchTab(path, params = {}) {
+				
+				if(path =='/pages/game/index'){
+					toast("功能暂未开放!")
+					return false
+				}
+				
 				if (getUserIdentity() == 'Visitor') {
 					uni.redirectTo({
 						url: path + '?nianji=' + this.nianji + '&cardId=' + this.cardId + '&zhangId=' + this

+ 24 - 7
pages/game/index.vue

@@ -1,10 +1,27 @@
 <!-- 游戏页面 -->
 <template>
-	<view>这是游戏页面</view>
-</template>
-
-<script>
-</script>
-
-<style>
+	<view>这是游戏页面</view>
+	<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
+</template>
+
+<script setup>
+	import {
+		reactive,
+		ref,
+		getCurrentInstance,
+		onMounted
+	} from "vue";
+	import {
+		onLoad
+	} from '@dcloudio/uni-app';
+	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
+	const zhangId = ref(null); //游客使用
+	const nianji = ref(null); //游客使用
+	const cardId = ref(null); //游客使用
+	onLoad((options) => {
+
+	})
+</script>
+
+<style>
 </style>

+ 15 - 7
pages/study/index.vue

@@ -224,11 +224,20 @@
 			url: `/pages/unitTest/index?jieNumber=`+data.number
 		})
 	}
-	function goLookShipin(data) {
-		uni.redirectTo({
-			//url: '/pages/study/lookShipin?studyData=' + JSON.stringify(pageData)
-			url: '/pages/study/lookShipin?jieNumber='+data.number
-		})
+	function goLookShipin(data) {
+		if (!cacheManager.get('auth') ){
+			
+			uni.redirectTo({
+				url: '/pages/study/lookShipin?jieNumber='+data.number+ '&cardId=' + cardId.value+ '&nianji=' + nianji.value+ '&zhangId=' + zhangId.value+ '&videoId=' + infoData.jieList[0].videoId
+			})
+			return;
+		}else{
+			uni.redirectTo({
+				url: '/pages/study/lookShipin?jieNumber='+data.number
+			})
+		}
+		
+
 	}
 	function listClick(data, index) {
 		if (!cacheManager.get('auth')&&data.number != 1) {
@@ -237,8 +246,7 @@
 				url: '/pages/login/index'
 			})
 			return;
-		}
-		debugger
+		}
 		const authCode = getUserIdentity();
 		if (!(authCode=='VIP' || data.number == 1)) {
 			goPayDialogRef.value.handleShow();

+ 23 - 8
pages/study/lookShipin.vue

@@ -68,6 +68,9 @@
 				jieName: '',
 				hideFlag: 'show',
 				videoId: "", //阿里云视频id
+				cardId: '',
+				nianji: '',
+				zhangId: '',
 				seekTime: '',
 				jieNumber: '',
 				shipinTitle: '',
@@ -75,9 +78,16 @@
 			}
 		},
 		onLoad(options) {
-
-			this.init(options)
-
+			if (!cacheManager.get('auth')) {
+				// 游客
+				this.videoId = options.videoId
+				this.nianji = options.nianji
+				this.zhangId = options.zhangId
+				this.cardId = options.cardId
+				this.getLive(); //获取播放凭证
+			} else {
+				this.init(options)
+			}
 		},
 		onHide() {
 			console.log('onHideonHideonHideonHide');
@@ -175,12 +185,17 @@
 				});
 			},
 			goUpPage() {
-				// this.$refs.popupRef.open();
-				uni.redirectTo({
-					//	url: `/pages/study/index?xueqi=${data.activeXueqi}&nianji=${data.activeNianji}&flag=selectGrades`
-					url: `/pages/study/index`
+				if (!cacheManager.get('auth')) {
+					uni.redirectTo({
+						url: '/pages/study/index?cardId=' + this.cardId+ '&nianji=' + this.nianji+ '&zhangId=' + this.zhangId
+					})
+				} else {
+					uni.redirectTo({
+						url: `/pages/study/index`
+
+					})
+				}
 
-				}) 
 			}
 
 		},