|
@@ -50,7 +50,8 @@
|
|
|
<!-- 回家箭头 -->
|
|
|
<view class="home-arrow" @click="goHome" :animation="homeArrowAnimation" :style="{ opacity: homeArrowVisible ? 1 : 0 }">
|
|
|
<!-- <image src="/static/island/home_arrow.png" mode="widthFix" style="width: 100rpx;"></image> -->
|
|
|
- <text class="home-text">⬅回家</text>
|
|
|
+ <view class="arrow" ></view>
|
|
|
+ <text class="home-text">回家</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -104,7 +105,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
// // 背景位置控制
|
|
|
- translateX: 0,
|
|
|
+ translateX: -200,
|
|
|
startX: 0,
|
|
|
currentX: 0,
|
|
|
isDragging : false,
|
|
@@ -177,16 +178,16 @@ export default {
|
|
|
this.maxTranslate = this.backgroundWidth - this.screenWidth;
|
|
|
|
|
|
// 初始位置居中
|
|
|
- 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.screenWidth);
|
|
|
- console.log('最大可移动距离:',this.maxTranslate);
|
|
|
+ // console.log('屏幕宽度:', this.screenWidth);
|
|
|
+ // console.log('背景宽度:', this.backgroundWidth);
|
|
|
+ // console.log('岛屿高度:', this.islandHeight);
|
|
|
+ // console.log('屏幕宽度:',this.screenWidth);
|
|
|
+ // console.log('最大可移动距离:',this.maxTranslate);
|
|
|
|
|
|
- console.log('岛屿data:', data);
|
|
|
+ // console.log('岛屿data:', data);
|
|
|
|
|
|
} else {
|
|
|
console.error('未能获取岛屿图片的尺寸');
|
|
@@ -507,6 +508,16 @@ export default {
|
|
|
z-index: 10;
|
|
|
transition: opacity 0.5s ease-in-out; // 添加淡入效果
|
|
|
|
|
|
+ .arrow {
|
|
|
+ content: '';
|
|
|
+ display: block;
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ background: url('/static/island/arrow.png') no-repeat center center;
|
|
|
+ background-size: contain;
|
|
|
+ transform: rotate(90deg);
|
|
|
+ }
|
|
|
+
|
|
|
.home-text {
|
|
|
color: #ffffff;
|
|
|
font-size: 32rpx;
|