瀏覽代碼

设置界面id显示优化

薛鸿潇 5 年之前
父節點
當前提交
d2be23b578
共有 2 個文件被更改,包括 8 次插入3 次删除
  1. 3 3
      assets/script/game/module/setting/Setting.ts
  2. 5 0
      assets/script/mk/system/MKSystem.ts

+ 3 - 3
assets/script/game/module/setting/Setting.ts

@@ -36,7 +36,7 @@ export default class Setting extends cc.Component {
     private async initData() {
         console.log("=== gData.wechatData.unionid", gData.wechatData.unionid);
         console.log("=== gData.wechatData.nickName", gData.wechatData.nickName);
-        this.lbl_id.string = "ID:" + gData.wechatData.unionid;
+        this.lbl_id.string = "ID:" + mk.string.getNewLimitStr(gData.wechatData.unionid, 10);// 14 
         this.lbl_nickname.string = gData.wechatData.nickName;
         let music = "module/setting/texture/" + (mk.audio.getSwitchMusic() ? "on" : "off");
         let effect = "module/setting/texture/" + (mk.audio.getSwitchEffect() ? "on" : "off");
@@ -97,7 +97,7 @@ export default class Setting extends cc.Component {
     }
 
     onClickClose() {
-       mk.ad.destroyNativeAd();
-       mk.ad.checkShowInterByChance();
+        mk.ad.destroyNativeAd();
+        mk.ad.checkShowInterByChance();
     }
 }

+ 5 - 0
assets/script/mk/system/MKSystem.ts

@@ -21,6 +21,7 @@ import PoolSystem from "./PoolSystem";
 import TweenUtil from "../utils/TweenUtil";
 import FlySystem from "./FlySystem";
 import GuideSystem from "./GuideSystem";
+import StringUtil from "../utils/StringUtil";
 
 /**
  * @description mk系统
@@ -64,6 +65,10 @@ class MKSystem {
     public get math(): MathUtil {
         return this._math || (this._math = new MathUtil());
     }
+    private _string: StringUtil;
+    public get string(): StringUtil {
+        return this._string || (this._string = new StringUtil());
+    }
     private _tween: TweenUtil;
     public get tween(): TweenUtil {
         return this._tween || (this._tween = new TweenUtil())