# 游戏中心复盘

1. 手机端的调试 对手机端的调试不是很熟悉
2. 涉及到次数的，一定要添加防抖

```js
    function throttle(fn, limit = 2000) {
      let flag = true
      return function() {
        if (flag) {
          fn.apply(this, arguments)
          flag = false
          setTimeout(() => { flag = true },  )
        }
      }
    }

  // mounted 里面
    self = this;
    this.debounceFn=
    throttle((num)=>{
        self.openPacket(num)
    })

    doLottery(num) {
      this.debounceFn(num)
    },

```

3. 次数的更新 这一次，涉及到次数，times 或者 composetimes 都没有处理好

```js
    NativeInterface.emit(Enum.INTERFACE_EVENT.UPDATE_TIMES);

    有个疑问点 为什么我的 写的锁 锁不住 ？

```

4. 埋点问题 postTask 和 dolottery 不一样， 两者的区分点在与游戏逻辑。

```js
// dolottery
* true  logger.makeActivityLog('activity_prize_got');
* false logger.makeActivityLog('activity_prize_failed');//调抽奖接口返回错误、异常埋点

//postTask
* true

* false  logger.makeActivityLog('activity_prizebad_juge'); // 获取lottery失败次数

```

5. 弹窗组件

对这个组件的不熟悉用法，涉及到多个 mixin 的组合，无法区分时机与用法

```js
DialogBuilder.of(this).alert(
  util.createComponentProxy(_BigTitle, { title: "恭喜你！" }),
  util.createComponentProxy(_LotteryResult, { award: realAward[0] })
);

DialogBuilder.of(this).confirm(
  util.createComponentProxy(_BigTitle, { title: "合成成功！" }),
  util.createComponentProxy(_LotteryResult, {
    award: award,
    awardNameColor: "#fcff29",
    tipsColor: "rgba(0,0,0,.5)",
  })
);
```

6. 样式问题 css 基础排版问题

* 导流活动对排版布局的不合理使用，例如:将粗暴的采用 flex 布局。
* 对引用组件样式修改恐惧

引用组件 如果 大范围修改，采用自己写的覆盖 小范围，寻找相对于 class 类名。

7. token

```js
self.$store.commit("setAccessToken", token);
```

```js
NativeInterface.goBackDirectly();
```

8. google 浏览器对自动播放做了限制

```js
let bgAudio = document.getElementById("bgaudio").play();
if (bgAudio !== undefined) {
  bgAudio
    .catch((error) => {
      console.log("error: ", error);
      // Auto-play was prevented
      // Show a UI element to let the user manually start playback
    })
    .then(() => {
      // Auto-play started
    });
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shenjunhong.gitbook.io/blog/chang-jian-zong-jie/meizu/you-xi-zhong-xin-fu-pan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
