future 1 year ago
parent
commit
66c1133702

+ 4 - 1
assets/scene/game.scene

@@ -5640,6 +5640,9 @@
     "btn_back": {
       "__id__": 149
     },
+    "img_title_bg": {
+      "__id__": 153
+    },
     "img_title": {
       "__id__": 154
     },
@@ -5954,7 +5957,7 @@
         "__id__": 222
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
         "__id__": 254

+ 12 - 1
assets/script/run/ui/back_title.ts

@@ -1,12 +1,18 @@
-import { _decorator, Component, Label, Node } from 'cc';
+import { _decorator, Component, Label, Node, Vec3 } from 'cc';
 import { gameManager } from '../gameManager';
+import { SdkUtil } from '../../sdkUtil';
 const { ccclass, property } = _decorator;
 
 @ccclass('back_title')
 export class back_title extends Component {
     @property(Node) btn_back:Node = null;
+    @property(Node) img_title_bg:Node = null;
     @property(Node) img_title:Node = null;
+    private img_title_bg_original_point:Vec3 = new Vec3(0,0,0)
     private mCallBack = null;
+    protected start(): void {
+        this.img_title_bg_original_point = this.img_title_bg.getPosition()
+    }
     public initView(title:string,call_back){
         this.mCallBack = call_back;
         this.updateTitle(title)
@@ -26,6 +32,11 @@ export class back_title extends Component {
             this.img_title.parent.active = true;
         }
         this.img_title.getComponent(Label).string = title;
+
+        if(SdkUtil.iPhoneIsLingdongdao()) {
+            let p = new Vec3(this.img_title_bg_original_point.x, this.img_title_bg_original_point.y - 60, this.img_title_bg_original_point.z)
+            this.img_title_bg.setPosition(p)
+        }
     }
 }
 

+ 3 - 1
assets/script/run/ui_layer.ts

@@ -15,6 +15,7 @@ import { back_title } from './ui/back_title';
 import { boss_tips } from './tips/boss_tips';
 import { content_only_tip } from './tips/content_only_tip';
 import { dai_dao_ju_bag } from './bag/dai_dao_ju_bag';
+import { SdkUtil } from '../sdkUtil';
 const { ccclass, property } = _decorator;
 
 @ccclass('ui_layer')
@@ -157,7 +158,8 @@ export class ui_layer extends Component {
     createCountDown(data:widget_item_data){
         let item = instantiate(this.count_down_prefab)
         item.parent = this.content_count_down;
-        item.position = new Vec3(data.att.x,data.att.y)
+        let add_y:number = 350 - (SdkUtil.iPhoneIsLingdongdao()?60:0)
+        item.position = new Vec3(data.att.x,data.att.y+add_y)
         this.mAttCountDown = item.getComponent(count_down)
         this.mAttCountDown.init(data.att.count_down,this.onCountDownOver.bind(this),data)
         this.mAttCountDown.startCountDown()

+ 17 - 0
assets/script/sdkUtil.ts

@@ -35,6 +35,23 @@ export class SdkUtil {
         })
     }
 
+    public static iPhoneIsLingdongdao():boolean {
+        if(sys.platform==sys.Platform.BYTEDANCE_MINI_GAME) {
+            if(SdkUtil.tt_systemInfo !=null) {
+                if(SdkUtil.tt_systemInfo.brand=='Apple'||SdkUtil.tt_systemInfo.brand=='devtools')
+                if(SdkUtil.tt_systemInfo.model=='iPhone 14'||
+                   SdkUtil.tt_systemInfo.model=='iPhone 14 Pro'||
+                   SdkUtil.tt_systemInfo.model=='iPhone 14 Pro Max'||
+                   SdkUtil.tt_systemInfo.model=='iPhone 15'||
+                   SdkUtil.tt_systemInfo.model=='iPhone 15 Pro'||
+                   SdkUtil.tt_systemInfo.model=='iPhone 15 Pro Max') {
+                    return true
+                }
+            }
+        }
+        return false
+    }
+
     /**
        * 自定义事件统计
        *