Ver Fonte

错题调整

wangxy há 4 meses atrás
pai
commit
7afc8bef6b

+ 2 - 2
components/custom-tabbar/custom-tabbar.vue

@@ -51,10 +51,10 @@
 
 			switchTab(path, params = {}) {
 				
-				if(path =='/pages/game/index'){
+				/* if(path =='/pages/game/index'){
 					toast("功能暂未开放!")
 					return false
-				}
+				} */
 				
 				if (getUserIdentity() == 'Visitor') {
 					uni.redirectTo({

+ 17 - 17
pages/game/index.vue

@@ -1,26 +1,26 @@
 <!-- 游戏页面 -->
 <template>
-	<view>这是游戏页面</view>
-	<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
+	<!-- 积分 -->
+	<view>{{credit}}</view>
+	<!-- 桌面食物 -->
+	<foodVue :shiwuId="shiwuId"></foodVue>
+	<!-- 大鹅 4阶段 -->
+	<gooseVue :growth="growth" :growthType="growthType" :progress="progress"></gooseVue>
+	<!-- 食物选择 -->
+	<foodSelectVue :shiwuId="shiwuId" @weishi="onWeiShi"></foodSelectVue>
 </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) => {
 
-	})
+	import foodVue from "./components/food.vue";
+	import gooseVue from "./components/goose.vue";
+	import foodSelectVue from "./components/foodSelect.vue";
+	import { useGame } from "./useGame";
+	const {	credit,growth,growthType,progress,shiwuId ,handleWeishi } = useGame();
+	
+	function onWeiShi(data) {
+		handleWeishi(data)
+	}
 </script>
 
 <style>

+ 7 - 1
pages/wrong/index.vue

@@ -63,6 +63,7 @@
 			</view>
 		</view>
 		<cuoti ref="wrongRef" :list="data.wrongList" @back="handleBackFromCuoti"></cuoti>
+		<CustomTabBar :cardId="cardId" :nianji="nianji" :zhangId="zhangId"></CustomTabBar>
 	</view>
 </template>
 
@@ -81,7 +82,12 @@
 	import {
 		getWrongInfo
 	} from "@/api/wrong";
-
+	import CustomTabBar from '@/components/custom-tabbar/custom-tabbar.vue';
+	
+	const zhangId = ref(null);
+	const nianji = ref(null);
+	const cardId = ref(null);
+	
 	const wrongRef = ref(null);
 
 	const data = reactive({

+ 2 - 0
utils/constant.js

@@ -42,3 +42,5 @@ export const xueke_list = [
 
 export const MESSAGE_BEFORE_PAY = `当前为非会员模式请先购买!`;
 export const MESSAGE_VISITER_TO_LOGIN = `您当前是游客身份,登录后才能浏览内容,现在去登录?`;
+
+