Parcourir la source

修改找朋友

smallqiang il y a 5 ans
Parent
commit
0bb75e2b9a

+ 2 - 2
assets/resources/prefabs/friend/game_friend_item.prefab

@@ -670,7 +670,7 @@
     "asset": {
       "__uuid__": "7ba201b2-eaec-4b5e-b272-eb636e2842cd"
     },
-    "fileId": "0e8dv/YlhLgpbvE+q08GRh",
+    "fileId": "7cbCd4Qh1IKK2rAgUjVkY9",
     "sync": false
   },
   {
@@ -1096,7 +1096,7 @@
     "asset": {
       "__uuid__": "7ba201b2-eaec-4b5e-b272-eb636e2842cd"
     },
-    "fileId": "5ecNqRkylIIJ+xLWYqabOf",
+    "fileId": "59R5NI2yxMfIJLwsMGy9t+",
     "sync": false
   },
   {

Fichier diff supprimé car celui-ci est trop grand
+ 1235 - 168
assets/resources/prefabs/precedence/game_friend.prefab


BIN
assets/resources/textures/friend/game_friend_search_bg.png


+ 31 - 0
assets/resources/textures/friend/game_friend_search_bg.png.meta

@@ -0,0 +1,31 @@
+{
+  "ver": "2.2.0",
+  "uuid": "6e65ba7d-1371-4a72-b3e1-9ebf2776186c",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "subMetas": {
+    "game_friend_search_bg": {
+      "ver": "1.0.3",
+      "uuid": "7bea90db-e67c-49c9-9f66-6947efbb7879",
+      "rawTextureUuid": "6e65ba7d-1371-4a72-b3e1-9ebf2776186c",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 628,
+      "height": 163,
+      "rawWidth": 628,
+      "rawHeight": 163,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

+ 2 - 2
assets/scripts/friend/GameFriendCtrl.js

@@ -128,8 +128,8 @@ cc.Class({
     _initSearch() {
         if(!this.initSearchDone) {
             this.initSearchDone = true;
-            // this.crowdNode = this.crowdNode.getComponent('GameCrowdRank');
-            // this.crowdNode.init(this);
+            this.searchNode = this.searchNode.getComponent('GameFriendSearch');
+            this.searchNode.init(this);
         }
     },
 

+ 63 - 0
assets/scripts/friend/GameFriendSearch.js

@@ -0,0 +1,63 @@
+
+cc.Class({
+    extends: cc.Component,
+
+    properties: {
+        userIdRichText: cc.RichText,
+        copyRichText: cc.RichText,
+
+
+    },
+
+    // LIFE-CYCLE CALLBACKS:
+
+    onLoad () {
+        this.userId = GameGlobal.user.uid;
+        this.userIdRichText.string = `<b><outline color=#75bc42 width=2>我的ID:${this.userId}</outline></b>`;
+
+        this.copyRichText.node.on(cc.Node.EventType.TOUCH_END, (event) => {
+            this.copyUserId();
+        }, this);
+    },
+
+    onDestroy() {
+
+    },
+
+    start () {
+
+    },
+
+    init() {
+
+    },
+
+    //复制我的ID
+    copyUserId() {
+        if (window.tt != undefined) {
+
+        } else if (CC_WECHATGAME) {
+            wx.setClipboardData({
+                data: this.userId,
+                success(res) {
+                    wx.getClipboardData({
+                        success(res) {
+                            GameGlobal.commonAlert.showCommonErrorAlert('复制成功');
+                        }
+                    })
+                },
+                fail() {
+                    GameGlobal.commonAlert.showCommonErrorAlert('复制失败请重试');
+                }
+            })
+        } else {
+            GameGlobal.commonAlert.showCommonErrorAlert('复制成功');
+        }
+    },
+
+    addFriend() {
+
+    }
+
+    // update (dt) {},
+});

+ 9 - 0
assets/scripts/friend/GameFriendSearch.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "a9fbbc90-aee4-4cd9-9af9-8a7bf3235213",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff