|
@@ -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>
|