|
@@ -14,9 +14,16 @@
|
|
|
<gooseVue :growth="growth" :growthType="growthType" :progress="progress"
|
|
|
class="game-goose-box" :class="'game-goose-box'+ growthType"></gooseVue>
|
|
|
<!-- 食物选择 -->
|
|
|
- <foodSelectVue ref="foodSelectRef" :shiwuId="shiwuId" @weishi="onWeiShi"></foodSelectVue>
|
|
|
+ <foodSelectVue :credit="credit" ref="foodSelectRef" :shiwuId="shiwuId" @weishi="onWeiShi"></foodSelectVue>
|
|
|
<!-- 游戏说明 -->
|
|
|
- <view class="yxsm-btn"></view>
|
|
|
+ <view class="yxsm-btn" @click="showTishi"></view>
|
|
|
+ <!-- 游戏说明 -->
|
|
|
+ <commonDialogVue ref="dlRef">
|
|
|
+ <view>
|
|
|
+ <text>这是内容区域</text>
|
|
|
+ <button @click="handleClose">关闭</button>
|
|
|
+ </view>
|
|
|
+ </commonDialogVue>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -25,10 +32,20 @@
|
|
|
import foodVue from "./components/food.vue";
|
|
|
import gooseVue from "./components/goose.vue";
|
|
|
import foodSelectVue from "./components/foodSelect.vue";
|
|
|
+ import commonDialogVue from "@/components/dialog/commonDialog.vue";
|
|
|
import { useGame } from "./useGame";
|
|
|
const { credit,growth,growthType,progress,shiwuId ,handleWeishi } = useGame();
|
|
|
|
|
|
const foodSelectRef = ref(null);
|
|
|
+ const dlRef = ref(null);
|
|
|
+
|
|
|
+ function handleClose() {
|
|
|
+ dlRef.value.handleClose();
|
|
|
+ }
|
|
|
+
|
|
|
+ function showTishi() {
|
|
|
+ dlRef.value.handleShow();
|
|
|
+ }
|
|
|
|
|
|
function onWeiShi(data) {
|
|
|
handleWeishi(data.id, () => {
|