Ver código fonte

上传老家引导的部分

lalalashen 2 meses atrás
pai
commit
6291a28b29

+ 78 - 58
components/guide/GuideManager.vue

@@ -33,7 +33,7 @@ export default {
       // 已完成阶段
       completedStages: [],
       // 已完成的主线
-      completedMainLines: [],
+      // completedMainLines: [],
       // 引导配置
       guideConfig: {
         mainLines: [
@@ -47,28 +47,7 @@ export default {
                   {
                     characterImage: '/static/island/npc.png',
                     characterName: '罗宾',
-                    text: '这位大人,这里太大了吧....',
-                    position: 'left',
-                    isMirror: true
-                  },
-                  {
-                    characterImage: '/static/island/building/1.png',
-                    characterName: '我',
-                    text: '好的,我马上上会教付清',
-                    position: 'right',
-                    isMirror: false
-                  },
-                  {
-                    characterImage: '/static/island/building/1.png',
-                    characterName: '我',
-                    text: '很奇怪不是吗?',
-                    position: 'right',
-                    isMirror: false
-                  },
-                  {
-                    characterImage: '/static/island/npc.png',
-                    characterName: '罗宾',
-                    text: '怎么回事',
+                    text: '你好!欢迎来到萌创星球,你的移民计划正式完成。',
                     position: 'left',
                     isMirror: true
                   }
@@ -80,24 +59,17 @@ export default {
                   {
                     characterImage: '/static/island/npc.png',
                     characterName: '罗宾',
-                    text: '工作台在这里呢',
+                    text: '这里是工具台 ,它可以制作各实用和非常棒的工具和装饰物,千万不要错过哟。',
                     position: 'left',
                     isMirror: true
                   },
-                  {
-                    characterImage: '/static/island/building/1.png',
-                    characterName: '我',
-                    text: '好的,我去看看',
-                    position: 'right',
-                    isMirror: false
-                  }
                 ]
               }
             ]
           },
           {
             name: "new craftsman",
-            stage: "mainLand_table",
+            stage: "homeLand_table",
             steps: [
               {
                 arrow: null,
@@ -105,7 +77,7 @@ export default {
                   {
                     characterImage: '/static/island/npc.png',
                     characterName: '罗宾',
-                    text: '工作台在这里呢!',
+                    text: '果然很顺利的打开了工作台呢!',
                     position: 'left',
                     isMirror: true
                   },
@@ -116,16 +88,23 @@ export default {
                     position: 'right',
                     isMirror: false
                   },
+                  {
+                    characterImage: '/static/island/npc.png',
+                    characterName: '罗宾',
+                    text: '材料确实不太容易获取呢,可以去看看公告栏。',
+                    position: 'left',
+                    isMirror: true
+                  }
 
                 ]
               },
               {
-                arrow: {x: 750, y: 660, r: 270},
+                arrow: {x: 885, y: 535, r: 270},
                 talkData: [
                   {
                     characterImage: '/static/island/npc.png',
                     characterName: '罗宾',
-                    text: '是的呀,也可以去看看别人发布的任务,获取材料呢!',
+                    text: '看到小箭头指示的地方了么...那是任务看板,可以获取一些稀有道具和铃钱哦。',
                     position: 'left',
                     isMirror: true
                   }
@@ -134,16 +113,51 @@ export default {
             ]
           },
           {
-            name: "new flower farmer",
-            stage: "mainLand",
+            name: "oh, taskBoard",
+            stage: "homeLand_TaskBoard",
             steps: [
               {
-                arrow: {x: 50, y: 50, r: 90},
+                arrow: null,
                 talkData: [
                   {
                     characterImage: '/static/island/npc.png',
                     characterName: '罗宾',
-                    text: '这里可以种花呦....',
+                    text: '这里就是任务面板呦....',
+                    position: 'left',
+                    isMirror: true
+                  },
+                  {
+                    characterImage: '/static/island/npc.png',
+                    characterName: '罗宾',
+                    text: '顺便说一下,你的移民计划正式开启目前您需要缴纳移民费用为388888元。也在任务面板发布了呦~',
+                    position: 'left',
+                    isMirror: true
+                  },
+                  {
+                    characterImage: '/static/island/building/1.png',
+                    characterName: '我',
+                    text: '什么!移民费用388888铃钱,这也太贵了吧...',
+                    position: 'right',
+                    isMirror: false
+                  },
+                  {
+                    characterImage: '/static/island/npc.png',
+                    characterName: '罗宾',
+                    text: '移民本就是一件不容易的事呢...',
+                    position: 'left',
+                    isMirror: true
+                  },
+                  {
+                    characterImage: '/static/island/npc.png',
+                    characterName: '罗宾',
+                    text: '对了,听说近期市政厅那边的花田正在招募园丁,报酬丰厚,',
+                    position: 'left',
+                    isMirror: true
+                  },
+                  {
+                    characterImage: '/static/island/npc.png',
+                    characterName: '罗宾',
+                    text: '相信以你的能力完全是没问题的,右侧过桥后就到了。',
                     position: 'left',
                     isMirror: true
                   }
@@ -274,9 +288,9 @@ export default {
       }
 
       // 检查主线是否已完成
-      if (this.completedMainLines.includes(this.currentMainLineId)) {
-        return false;
-      }
+      // if (this.completedMainLines.includes(this.currentMainLineId)) {
+      //   return false;
+      // }
 
       // 设置当前主线
       this.currentMainLine = mainLine;
@@ -346,29 +360,33 @@ export default {
     completeMainLine() {
       if (this.currentMainLine) {
         // 添加到已完成列表
-        this.completedMainLines.push(this.currentMainLine.name);
+        // this.completedMainLines.push(this.currentMainLineId);
         
         // 保存到本地存储
-        this.saveCompletedMainLines();
+        // this.saveCompletedMainLines();
         
         // 重置状态
         this.currentMainLine = null;
         this.currentStepIndex = 0;
         this.currentTalkIndex = 0;
         this.currentTalkData = [];
+        
+        // 增加主线ID
+        this.currentMainLineId++;
+        this.saveCurrentMainLineId();
       }
     },
     // 保存已完成主线
-    saveCompletedMainLines() {
-      uni.setStorageSync('completedGuideMainLines', this.completedMainLines);
-    },
+    // saveCompletedMainLines() {
+    //   uni.setStorageSync('completedGuideMainLines', this.completedMainLines);
+    // },
     // 加载已完成主线
-    loadCompletedMainLines() {
-      const mainLines = uni.getStorageSync('completedGuideMainLines');
-      if (mainLines) {
-        this.completedMainLines = mainLines;
-      }
-    },
+    // loadCompletedMainLines() {
+    //   const mainLines = uni.getStorageSync('completedGuideMainLines');
+    //   if (mainLines) {
+    //     this.completedMainLines = mainLines;
+    //   }
+    // },
     // 获取当前箭头位置
     getCurrentArrowPosition() {
       if (!this.currentMainLine || !this.currentMainLine.steps[this.currentStepIndex]) {
@@ -404,14 +422,14 @@ export default {
           )
           
           // 如果主线完成,添加到已完成主线列表
-          if (isMainLineCompleted && !this.completedMainLines.includes(mainLineId)) {
-            this.completedMainLines.push(mainLineId)
-          }
+          // if (isMainLineCompleted && !this.completedMainLines.includes(mainLineId)) {
+          //   this.completedMainLines.push(mainLineId)
+          // }
         }
         
         // 保存到本地存储
         this.saveCompletedStages()
-        this.saveCompletedMainLines()
+        // this.saveCompletedMainLines()
         
         // 重置状态
         this.currentStage = null
@@ -448,8 +466,10 @@ export default {
   },
   mounted() {
     // 加载已完成主线和当前主线ID
-    this.loadCompletedMainLines();
+    // this.loadCompletedMainLines();
     this.loadCurrentMainLineId();
+    //测试重置主线
+    this.currentMainLineId=0;
   }
 }
 </script>

+ 11 - 7
pages/isLand/homeLand.vue

@@ -31,7 +31,7 @@
       <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> -->
 		<view class="arrow" ></view>
-        <text class="main-text">主岛{{ showGuideArrow }}</text>
+        <text class="main-text">主岛</text>
 
       </view>
     </view>
@@ -188,7 +188,7 @@ export default {
 	},
 	onShow() {
 		// 检查是否需要显示引导
-		this.checkAndShowGuide();
+		this.checkAndShowGuide('homeLand');
 	},
 	onReady() {
 		// 在组件渲染完成后获取图片尺寸
@@ -328,6 +328,8 @@ export default {
 			
 			// 显示制造台界面
 			this.craftingVisible = true;
+
+			this.checkAndShowGuide('homeLand_table');
 		},
 
 		onTaskClick(event) {
@@ -418,7 +420,9 @@ export default {
 		},
 		showTask() {
 			console.log('Opening task board...')
-			this.taskVisible = true
+			this.taskVisible = true;
+			this.checkAndShowGuide('homeLand_TaskBoard');
+
 		},
 		onTaskClose() {
 			console.log('Closing task board...')
@@ -459,11 +463,13 @@ export default {
 			});
 		},
 		// 检查并显示引导
-		checkAndShowGuide() {
+		checkAndShowGuide(stageId) {
+			console.log('checkAndShowGuide stageId :', stageId);
 			// 延迟执行以确保DOM已经渲染
 			setTimeout(() => {
 				if (this.$refs.guideManager) {
-					const hasGuide = this.$refs.guideManager.startGuide('homeLand');
+					const hasGuide = this.$refs.guideManager.startGuide(stageId);
+					console.log('checkAndShowGuide hasGuide :', hasGuide);
 					if (hasGuide) {
 						this.currentTalkData = this.$refs.guideManager.getCurrentTalkData();
 						console.log('checkAndShowGuide currentTalkData :', this.currentTalkData);
@@ -474,8 +480,6 @@ export default {
 						}else{
 							console.log('currentTalkData err:', this.currentTalkData);
 						}
-
-						
 					}
 				}
 			}, 200);

+ 1 - 1
pages/isLand/talkGuide.vue

@@ -95,7 +95,7 @@ export default {
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.5);
-  z-index: 999;
+  z-index: 99999;
 
   .guide-content {
     position: absolute;