|
@@ -11,17 +11,21 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view style="position: absolute;width: 300rpx;left:280rpx; bottom:200rpx;align-items: center;">
|
|
<view style="position: absolute;width: 300rpx;left:280rpx; bottom:200rpx;align-items: center;">
|
|
- <image class="table-image" src="/static/island/building/workTable.png" mode="widthFix" style="width:670rpx; position: static;" @click="onHallClick" :animation="hallAnimationData"> </image>
|
|
|
|
|
|
+ <image class="table-image" src="/static/island/building/workTable.png" mode="widthFix" style="width:670rpx; position: static;" @click="onTableClick" :animation="tableAnimationData"> </image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view style="position: absolute;width:200rpx;left:660rpx; bottom:260rpx;align-items: center;">
|
|
<view style="position: absolute;width:200rpx;left:660rpx; bottom:260rpx;align-items: center;">
|
|
<image class="mailBox-image" src="/static/island/building/mailBox.png" mode="widthFix" style="width:670rpx; position: static;" > </image>
|
|
<image class="mailBox-image" src="/static/island/building/mailBox.png" mode="widthFix" style="width:670rpx; position: static;" > </image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
+ <view style="position: absolute;width:200rpx;left:1000rpx; bottom:450rpx;align-items: center;">
|
|
|
|
+ <image class="taskBoard-image" src="/static/island/building/taskBoard.png" mode="widthFix" style="width:670rpx; position: static;" @click="onTaskClick" :animation="taskAnimationData"> </image>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
<!-- 主岛箭头 -->
|
|
<!-- 主岛箭头 -->
|
|
<view class="main-arrow" @click="goToMainLand" :animation="mainArrowAnimation" :style="{ opacity: mainArrowVisible ? 1 : 0 }">
|
|
<view class="main-arrow" @click="goToMainLand" :animation="mainArrowAnimation" :style="{ opacity: mainArrowVisible ? 1 : 0 }">
|
|
<image src="/static/island/main_arrow.png" mode="widthFix" style="width: 100rpx;"></image>
|
|
<image src="/static/island/main_arrow.png" mode="widthFix" style="width: 100rpx;"></image>
|
|
- <text class="main-text">主岛</text>
|
|
|
|
|
|
+ <text class="main-text">去主岛</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -60,6 +64,9 @@
|
|
:player-name="playerName"
|
|
:player-name="playerName"
|
|
@guide-complete="onGuideComplete"
|
|
@guide-complete="onGuideComplete"
|
|
></talk-guide>
|
|
></talk-guide>
|
|
|
|
+
|
|
|
|
+ <!-- 制造台对话框组件 -->
|
|
|
|
+ <crafting-dialog :visible.sync="craftingVisible" @close="craftingVisible = false"></crafting-dialog>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -70,6 +77,7 @@ import CharacterDialog from '@/components/dialogs/CharacterDialog.vue'
|
|
import ShopDialog from '@/components/dialogs/ShopDialog.vue'
|
|
import ShopDialog from '@/components/dialogs/ShopDialog.vue'
|
|
import TaskDialog from './TaskDialog.vue'
|
|
import TaskDialog from './TaskDialog.vue'
|
|
import TalkGuide from './talkGuide.vue'
|
|
import TalkGuide from './talkGuide.vue'
|
|
|
|
+import CraftingDialog from '@/components/dialogs/CraftingDialog.vue'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -77,7 +85,8 @@ export default {
|
|
CharacterDialog,
|
|
CharacterDialog,
|
|
ShopDialog,
|
|
ShopDialog,
|
|
TaskDialog,
|
|
TaskDialog,
|
|
- TalkGuide
|
|
|
|
|
|
+ TalkGuide,
|
|
|
|
+ CraftingDialog
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -92,9 +101,11 @@ export default {
|
|
backgroundWidth: 0,
|
|
backgroundWidth: 0,
|
|
islandHeight: 0,
|
|
islandHeight: 0,
|
|
houseAnimationData: {},
|
|
houseAnimationData: {},
|
|
- hallAnimationData: {},
|
|
|
|
|
|
+ tableAnimationData: {},
|
|
|
|
+ taskAnimationData: {},
|
|
houseAnimating: false,
|
|
houseAnimating: false,
|
|
- hallAnimating: false,
|
|
|
|
|
|
+ tableAnimating: false,
|
|
|
|
+ taskAnimating: false,
|
|
baseTranslate: { x: -50, y: 50 },
|
|
baseTranslate: { x: -50, y: 50 },
|
|
inventoryVisible: false,
|
|
inventoryVisible: false,
|
|
characterVisible: false,
|
|
characterVisible: false,
|
|
@@ -133,7 +144,8 @@ export default {
|
|
position: 'left',
|
|
position: 'left',
|
|
isMirror: true
|
|
isMirror: true
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
|
|
+ craftingVisible: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -179,12 +191,12 @@ export default {
|
|
this.translateX = -this.maxTranslate / 2;
|
|
this.translateX = -this.maxTranslate / 2;
|
|
|
|
|
|
// 打印调试信息
|
|
// 打印调试信息
|
|
- console.log('屏幕宽度:', this.screenWidth);
|
|
|
|
- console.log('背景宽度:', this.backgroundWidth);
|
|
|
|
- console.log('岛屿高度:', this.islandHeight);
|
|
|
|
- console.log('最大可移动距离:',this.maxTranslate);
|
|
|
|
|
|
+ // console.log('屏幕宽度:', this.screenWidth);
|
|
|
|
+ // console.log('背景宽度:', this.backgroundWidth);
|
|
|
|
+ // console.log('岛屿高度:', this.islandHeight);
|
|
|
|
+ // console.log('最大可移动距离:',this.maxTranslate);
|
|
|
|
|
|
- console.log('岛屿data:', data);
|
|
|
|
|
|
+ // console.log('岛屿data:', data);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
console.error('未能获取岛屿图片的尺寸');
|
|
console.error('未能获取岛屿图片的尺寸');
|
|
@@ -270,16 +282,27 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
- onHallClick(event) {
|
|
|
|
- if(this.hallAnimating) return;
|
|
|
|
|
|
+ onTableClick(event) {
|
|
|
|
+ if(this.tableAnimating) return;
|
|
|
|
+ console.log('Table clicked!');
|
|
|
|
+
|
|
|
|
+ // 播放大厅的点击动画
|
|
|
|
+ this.playAnimation('table');
|
|
|
|
+
|
|
|
|
+ // 显示制造台界面
|
|
|
|
+ this.craftingVisible = true;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ onTaskClick(event) {
|
|
|
|
+ if(this.taskAnimating) return;
|
|
// 处理点击事件
|
|
// 处理点击事件
|
|
- console.log('Hall clicked!');
|
|
|
|
|
|
+ console.log('Task clicked!');
|
|
|
|
|
|
// 播放大厅的点击动画
|
|
// 播放大厅的点击动画
|
|
- this.playAnimation('hall');
|
|
|
|
|
|
+ this.playAnimation('task');
|
|
|
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
- title: 'Hall clicked!',
|
|
|
|
|
|
+ title: 'task clicked!',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -290,8 +313,10 @@ export default {
|
|
// 根据类型设置对应的动画状态
|
|
// 根据类型设置对应的动画状态
|
|
if (type === 'house') {
|
|
if (type === 'house') {
|
|
this.houseAnimating = true;
|
|
this.houseAnimating = true;
|
|
- } else if (type === 'hall') {
|
|
|
|
- this.hallAnimating = true;
|
|
|
|
|
|
+ } else if (type === 'table') {
|
|
|
|
+ this.tableAnimating = true;
|
|
|
|
+ } else if (type === 'task') {
|
|
|
|
+ this.taskAnimating = true;
|
|
}
|
|
}
|
|
|
|
|
|
// 创建动画实例
|
|
// 创建动画实例
|
|
@@ -309,16 +334,20 @@ export default {
|
|
// 根据类型应用动画到对应的元素
|
|
// 根据类型应用动画到对应的元素
|
|
if (type === 'house') {
|
|
if (type === 'house') {
|
|
this.houseAnimationData = animation.export();
|
|
this.houseAnimationData = animation.export();
|
|
- } else if (type === 'hall') {
|
|
|
|
- this.hallAnimationData = animation.export();
|
|
|
|
|
|
+ } else if (type === 'table') {
|
|
|
|
+ this.tableAnimationData = animation.export();
|
|
|
|
+ } else if (type === 'task') {
|
|
|
|
+ this.taskAnimationData = animation.export();
|
|
}
|
|
}
|
|
|
|
|
|
// 动画结束后重置状态
|
|
// 动画结束后重置状态
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if (type === 'house') {
|
|
if (type === 'house') {
|
|
self.houseAnimating = false;
|
|
self.houseAnimating = false;
|
|
- } else if (type === 'hall') {
|
|
|
|
- self.hallAnimating = false;
|
|
|
|
|
|
+ } else if (type === 'table') {
|
|
|
|
+ self.tableAnimating = false;
|
|
|
|
+ } else if (type === 'task') {
|
|
|
|
+ self.taskAnimating = false;
|
|
}
|
|
}
|
|
}, 800);
|
|
}, 800);
|
|
},
|
|
},
|
|
@@ -370,7 +399,7 @@ export default {
|
|
const animate = () => {
|
|
const animate = () => {
|
|
if (!this.mainArrowAnimating) return;
|
|
if (!this.mainArrowAnimating) return;
|
|
|
|
|
|
- animation.translateY(-20).step({ duration: 1000 });
|
|
|
|
|
|
+ animation.translateY(-10).step({ duration: 1000 });
|
|
this.mainArrowAnimation = animation.export();
|
|
this.mainArrowAnimation = animation.export();
|
|
|
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -459,15 +488,14 @@ export default {
|
|
|
|
|
|
.main-arrow {
|
|
.main-arrow {
|
|
position: absolute;
|
|
position: absolute;
|
|
- right: 100rpx; // 调整到右边位置
|
|
|
|
- top: 50%;
|
|
|
|
- transform: translateY(-50%);
|
|
|
|
|
|
+ right: 100rpx;
|
|
|
|
+ bottom: 100rpx; // 改为 bottom 定位
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
z-index: 10;
|
|
z-index: 10;
|
|
- transition: opacity 0.5s ease-in-out; // 添加淡入效果
|
|
|
|
|
|
+ transition: opacity 0.5s ease-in-out;
|
|
|
|
|
|
.main-text {
|
|
.main-text {
|
|
color: #ffffff;
|
|
color: #ffffff;
|