Quellcode durchsuchen

feat: 不同进入入口逻辑区分

longyang vor 3 Wochen
Ursprung
Commit
67a1f2af97

+ 10 - 0
.workbuddy/memory/2026-05-06.md

@@ -0,0 +1,10 @@
+# 2026-05-06
+
+## Step 6 拆分为 3 步
+- 将原 Step 6(ProfileGuide)拆分为 3 个独立步骤,总步骤数从 7 变为 9
+- **Step 6** ProfileGuide(改造):只保留「我的积分」引导(积分列表/积分规则/活跃度判定)
+- **Step 7** ExchangeGuide(新建):引导「我的兑换」,介绍 5 种订单状态,按钮用 `setTab('exchange')` 激活对应 Tab
+- **Step 8** CouponGuide(新建):引导「我的礼品券」+ 兑换流程,按钮用 `setTab('welfare')` 激活对应 Tab
+- **Step 9** RewardGuide:内容不变,步骤号顺延
+- 复用 MyCenter 现有 Cookie 机制(`getTab`/`setTab`),无需改动 MyCenter.vue
+- index.vue 的 stepComponents 数组已更新

+ 13 - 0
.workbuddy/memory/2026-05-08.md

@@ -0,0 +1,13 @@
+# 2026-05-08 工作日志
+
+## MyCenter 新增「新手指引」Tab + 重新查看入口
+- 在 MyCenter.vue 末尾新增第 6 个 Tab(name="sixth"),包含引导卡片和「重新查看」按钮
+- 按钮通过 `$parent` 链向上查找 App 实例,调用 `showGuide()` 触发引导
+- `this.$root.$refs.guide` 在嵌套路由下不可用,改用 `$parent` 链方案
+
+## 首次/重新查看区分
+- index.vue `show()` 支持 `{ replay: true }` 参数,设置 `isReplay` 状态
+- `isReplay` 通过 prop 传递给所有步骤组件
+- RewardGuide 最后一步按钮:首次→「🎁 立即领取」,重新查看→「🚀 开始探索」
+- handleSkip:首次→弹确认框,重新查看→直接关闭不弹框
+- App.vue `showGuide()` 传 `{ replay: true }`

+ 4 - 1
.workbuddy/memory/MEMORY.md

@@ -38,4 +38,7 @@
   - Step 6 ProfileGuide — 我的积分
   - Step 7 ExchangeGuide — 我的兑换(`setTab('exchange')` 激活 Tab)
   - Step 8 CouponGuide — 礼品券兑换(`setTab('welfare')` 激活 Tab)
-  - Step 9 RewardGuide — 引导完成领奖
+  - Step 9 RewardGuide — 引导完成领奖(首次「🎁 立即领取」,重看「🚀 开始探索」)
+- MyCenter 新增「新手指引」Tab(name="sixth"),可通过「重新查看」按钮触发 `this.$root.$refs.guide.show()` 重播引导
+- 首次/重新查看区分:`show({ replay: true })`,isReplay 通过 prop 传递;跳过按钮首次弹确认框,重看直接关闭
+- ⚠️ 嵌套路由下 `this.$root.$refs.guide` 不可用,MyCenter 使用 `$parent` 链查找 App 实例

+ 1 - 1
src/App.vue

@@ -77,7 +77,7 @@ export default {
     },
     showGuide() {
       if (this.$refs.guide) {
-        this.$refs.guide.show();
+        this.$refs.guide.show({ replay: true });
       }
     },
     fatherMethod() {

+ 8 - 1
src/components/NewUserGuide/index.vue

@@ -24,6 +24,7 @@
             :key="currentStep"
             :isLast="isLastStep"
             :isFirst="isFirstStep"
+            :isReplay="isReplay"
             @next="goNext"
             @prev="goPrev"
           />
@@ -73,6 +74,7 @@ export default {
       currentStep: 1,
       totalSteps: stepComponents.length,
       steps: stepComponents,
+      isReplay: false,
     }
   },
   computed: {
@@ -91,7 +93,8 @@ export default {
   },
   methods: {
     /** 显示引导(可由外部调用) */
-    show() {
+    show(options = {}) {
+      this.isReplay = !!options.replay
       this.visible = true
       this.currentStep = 1
       this.totalSteps = this.steps.length
@@ -129,6 +132,10 @@ export default {
 
     /** 跳过引导 */
     handleSkip() {
+      if (this.isReplay) {
+        this.handleFinish()
+        return
+      }
       const mask = this.$el
       if (mask) mask.style.zIndex = '1000'
       this.$confirm(

+ 1 - 0
src/components/NewUserGuide/steps/ActivityGuide.vue

@@ -44,6 +44,7 @@ export default {
   props: {
     isLast: { type: Boolean, default: false },
     isFirst: { type: Boolean, default: false },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 1 - 0
src/components/NewUserGuide/steps/CouponGuide.vue

@@ -53,6 +53,7 @@ export default {
   props: {
     isLast: { type: Boolean, default: false },
     isFirst: { type: Boolean, default: false },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 1 - 0
src/components/NewUserGuide/steps/EarnPointsGuide.vue

@@ -41,6 +41,7 @@ export default {
   props: {
     isLast: { type: Boolean, default: false },
     isFirst: { type: Boolean, default: false },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 1 - 0
src/components/NewUserGuide/steps/ExchangeGuide.vue

@@ -46,6 +46,7 @@ export default {
   props: {
     isLast: { type: Boolean, default: false },
     isFirst: { type: Boolean, default: false },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 1 - 0
src/components/NewUserGuide/steps/PointsMallGuide.vue

@@ -41,6 +41,7 @@ export default {
   props: {
     isLast: { type: Boolean, default: false },
     isFirst: { type: Boolean, default: false },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 1 - 0
src/components/NewUserGuide/steps/ProfileGuide.vue

@@ -46,6 +46,7 @@ export default {
   props: {
     isLast: { type: Boolean, default: false },
     isFirst: { type: Boolean, default: false },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 2 - 1
src/components/NewUserGuide/steps/RewardGuide.vue

@@ -28,7 +28,7 @@
 
     <div class="guide-footer">
       <button class="btn-finish" @click="$emit('next')">
-        <span>🚀</span> 开始探索
+        <span>{{ isReplay ? '🚀' : '🎁' }}</span> {{ isReplay ? '开始探索' : '立即领取' }}
       </button>
       <button class="btn-prev" v-if="!isFirst" @click="$emit('prev')">
         上一步
@@ -43,6 +43,7 @@ export default {
   props: {
     isLast: { type: Boolean, default: false },
     isFirst: { type: Boolean, default: false },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 1 - 0
src/components/NewUserGuide/steps/SignInGuide.vue

@@ -76,6 +76,7 @@ export default {
       type: Boolean,
       default: false,
     },
+    isReplay: { type: Boolean, default: false },
   },
   data() {
     return {

+ 1 - 0
src/components/NewUserGuide/steps/WelcomeGuide.vue

@@ -63,6 +63,7 @@ export default {
       type: Boolean,
       default: false,
     },
+    isReplay: { type: Boolean, default: false },
   },
 }
 </script>