Forráskód Böngészése

添加温馨提示,隐私挽留弹窗和逻辑

mojunshou 8 hónapja
szülő
commit
52254d775b

+ 73 - 14
assets/bundle/common/prefab/kindTips.prefab

@@ -1,7 +1,7 @@
 [
   {
     "__type__": "cc.Prefab",
-    "_name": "kindTips",
+    "_name": "kind_tips",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_native": "",
@@ -13,7 +13,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "kindTips",
+    "_name": "kind_tips",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": null,
@@ -28,14 +28,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 64
+        "__id__": 66
       },
       {
-        "__id__": 66
+        "__id__": 68
       }
     ],
     "_prefab": {
-      "__id__": 68
+      "__id__": 70
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -297,14 +297,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 59
+        "__id__": 61
       },
       {
-        "__id__": 61
+        "__id__": 63
       }
     ],
     "_prefab": {
-      "__id__": 63
+      "__id__": 65
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1147,15 +1147,18 @@
       },
       {
         "__id__": 56
+      },
+      {
+        "__id__": 58
       }
     ],
     "_prefab": {
-      "__id__": 58
+      "__id__": 60
     },
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": -157.029,
+      "y": -160.301,
       "z": 0
     },
     "_lrot": {
@@ -1278,6 +1281,62 @@
     "fileId": "9cWch0bgBAxIjDAY1ukg+S"
   },
   {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 53
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 59
+    },
+    "clickEvents": [],
+    "_interactable": true,
+    "_transition": 0,
+    "_normalColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_hoverColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_pressedColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_normalSprite": null,
+    "_hoverSprite": null,
+    "_pressedSprite": null,
+    "_disabledSprite": null,
+    "_duration": 0.1,
+    "_zoomScale": 1.2,
+    "_target": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "8eaAHzv4tPtJLmS0uLw+ks"
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -1300,7 +1359,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 60
+      "__id__": 62
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1328,7 +1387,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 62
+      "__id__": 64
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -1386,7 +1445,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 65
+      "__id__": 67
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1414,7 +1473,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 67
+      "__id__": 69
     },
     "_id": ""
   },

+ 1 - 1
assets/bundle/common/prefab/kindTips.prefab.meta

@@ -8,6 +8,6 @@
   ],
   "subMetas": {},
   "userData": {
-    "syncNodeName": "kindTips"
+    "syncNodeName": "kind_tips"
   }
 }

+ 73 - 14
assets/bundle/common/prefab/retention.prefab

@@ -28,14 +28,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 73
+        "__id__": 75
       },
       {
-        "__id__": 75
+        "__id__": 77
       }
     ],
     "_prefab": {
-      "__id__": 77
+      "__id__": 79
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -315,14 +315,14 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 68
+        "__id__": 70
       },
       {
-        "__id__": 70
+        "__id__": 72
       }
     ],
     "_prefab": {
-      "__id__": 72
+      "__id__": 74
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1124,7 +1124,7 @@
     },
     "clickEvents": [],
     "_interactable": true,
-    "_transition": 0,
+    "_transition": 3,
     "_normalColor": {
       "__type__": "cc.Color",
       "r": 255,
@@ -1199,10 +1199,13 @@
       },
       {
         "__id__": 65
+      },
+      {
+        "__id__": 67
       }
     ],
     "_prefab": {
-      "__id__": 67
+      "__id__": 69
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -1466,6 +1469,62 @@
     "fileId": "01Z1COr/5FI61vOg8WVe9m"
   },
   {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 56
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 68
+    },
+    "clickEvents": [],
+    "_interactable": true,
+    "_transition": 3,
+    "_normalColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_hoverColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_pressedColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_normalSprite": null,
+    "_hoverSprite": null,
+    "_pressedSprite": null,
+    "_disabledSprite": null,
+    "_duration": 0.1,
+    "_zoomScale": 1.2,
+    "_target": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "0a6BV10vJFcpLoNIQxu9kF"
+  },
+  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -1488,7 +1547,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 69
+      "__id__": 71
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1516,7 +1575,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 71
+      "__id__": 73
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -1574,7 +1633,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 74
+      "__id__": 76
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -1593,7 +1652,7 @@
     "fileId": "d56fIqvVBHe5EA2CXpJHHO"
   },
   {
-    "__type__": "25efd23JY9Mqp4Gj/hKSCVY",
+    "__type__": "3f2b3CegpBFYaA8M5jiGJgI",
     "_name": "",
     "_objFlags": 0,
     "__editorExtras__": {},
@@ -1602,13 +1661,13 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 76
+      "__id__": 78
     },
     "_id": ""
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "67K0zjOOtE7ooqs5P7bnBc"
+    "fileId": "e8TuhKdBJAL4H7lgG/kiGW"
   },
   {
     "__type__": "cc.PrefabInfo",

+ 11 - 4
assets/script/game/common/config/GameUIConfig.ts

@@ -1,7 +1,7 @@
 /*
  * @Date: 2021-08-12 09:33:37
- * @LastEditors: dgflash
- * @LastEditTime: 2023-02-15 09:38:36
+ * @LastEditors: mojunshou 1637302775@qq.com
+ * @LastEditTime: 2025-03-19 18:37:51
  */
 import { LayerType, UIConfig } from "../../../../../extensions/oops-plugin-framework/assets/core/gui/layer/LayerManager";
 
@@ -14,7 +14,12 @@ export enum UIID {
     /** 确认弹出窗口 */
     Confirm,
     /** DEMO */
-    Demo
+    Demo,
+    /** 温馨提示 */
+    KindTips,
+    /** 隐私挽留弹窗 */
+    Retention
+
 }
 
 /** 打开界面方式的配置数据 */
@@ -23,4 +28,6 @@ export var UIConfigData: { [key: number]: UIConfig } = {
     [UIID.Alert]: { layer: LayerType.Dialog, prefab: "common/prefab/alert" },
     [UIID.Confirm]: { layer: LayerType.Dialog, prefab: "common/prefab/confirm" },
     [UIID.Demo]: { layer: LayerType.UI, prefab: "gui/demo/demo" },
-}
+    [UIID.KindTips]: { layer: LayerType.PopUp, prefab: "common/prefab/kind_tips" },
+    [UIID.Retention]: { layer: LayerType.PopUp, prefab: "common/prefab/retention" },
+}

+ 5 - 2
assets/script/game/common/tips/KindTipsView.ts

@@ -2,11 +2,13 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 18:02:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-19 18:03:09
- * @Description: 
+ * @LastEditTime: 2025-03-19 18:34:59
+ * @Description: 隐私政策弹窗
  */
 import { _decorator, Component, Node } from 'cc';
+import { oops } from 'db://oops-framework/core/Oops';
 import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
+import { UIID } from '../config/GameUIConfig';
 const { ccclass, property } = _decorator;
 
 @ccclass('KindTipsView')
@@ -26,6 +28,7 @@ export class KindTipsView extends GameComponent {
     private btn_disagree() {
         console.log("不同意");
         //打开新的挽留弹窗
+        oops.gui.open(UIID.Retention);
     }
 }
 

+ 30 - 0
assets/script/game/common/tips/RetentionView.ts

@@ -0,0 +1,30 @@
+/*
+ * @Author: mojunshou 1637302775@qq.com
+ * @Date: 2025-03-19 18:02:51
+ * @LastEditors: mojunshou 1637302775@qq.com
+ * @LastEditTime: 2025-03-19 18:38:24
+ * @Description: 隐私挽留弹窗
+ */
+import { game } from 'cc';
+import { _decorator, Component, Node } from 'cc';
+import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
+const { ccclass, property } = _decorator;
+
+@ccclass('RetentionView')
+export class RetentionView extends GameComponent {
+    start() {
+        this.setButton();
+    }
+
+    private btn_agree() {
+        console.log("同意");
+        //调用安卓给权限
+    }
+
+    private btn_disagree() {
+        console.log("不同意");
+        game.end();
+    }
+}
+
+

+ 9 - 0
assets/script/game/common/tips/RetentionView.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "3f2b309e-8290-4561-a03c-3398e2189808",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 13 - 1
assets/script/game/initialize/view/LoadingViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: dgflash
  * @Date: 2021-07-03 16:13:17
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-19 17:29:41
+ * @LastEditTime: 2025-03-19 18:33:16
  */
 import { _decorator } from "cc";
 import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
@@ -13,6 +13,7 @@ import { DemoViewComp } from "../../account/view/DemoViewComp";
 import { smc } from "../../common/SingletonModuleComp";
 import { UIID } from "../../common/config/GameUIConfig";
 import { EventTouch } from "cc";
+import { sys } from "cc";
 
 const { ccclass, property } = _decorator;
 
@@ -45,6 +46,17 @@ export class LoadingViewComp extends CCVMParentComp {
     }
 
     enter() {
+        //查看缓存有没有同意过
+        let data = sys.localStorage.getItem("agree");
+        if (!data) {
+            //打开温馨提示
+            oops.gui.open(UIID.KindTips);
+        }
+
+
+        // let data = oops.storage.get("agree");
+        console.log("data>>>>>>>>>>", data);
+        oops.log.logView("data>>>>>>>>>>", data);
         this.loadRes();
     }