瀏覽代碼

删掉图片错误处理

Roy 6 年之前
父節點
當前提交
2efb3221a3
共有 2 個文件被更改,包括 7 次插入4 次删除
  1. 0 1
      assets/Script/Rank/FriendRank.js
  2. 7 3
      assets/Script/Rank/RankItem.js

+ 0 - 1
assets/Script/Rank/FriendRank.js

@@ -45,7 +45,6 @@ cc.Class({
             var rankType = 0; //要查询的排行榜类型,0: 好友排行榜
             let self = this;
             BK.QQ.getRankListWithoutRoom(attr, order, rankType, function (errCode, cmd, data) {
-                BK.Script.log(1, 1, "getRankListWithoutRoom callback  cmd" + cmd + " errCode:" + errCode + "  data:" + JSON.stringify(data));
                 // 返回错误码信息
                 if (errCode !== 0) {
                     BK.Script.log(1, 1, '获取排行榜数据失败!错误码:' + errCode);

+ 7 - 3
assets/Script/Rank/RankItem.js

@@ -36,15 +36,19 @@ cc.Class({
         this.scoreLabel.string = data.score;
         this.nameLabel.string = data.nick;
 
+
+        if (CC_QQPLAY) {
+            var img = BK.Image.loadImage("GameRes://texture/icon.png");
+            this.avatar.spriteFrame = new cc.SpriteFrame(img);
+        }
+
         cc.loader.load({
             url: data.url, type: 'jpg'
         }, (err, texture) => {
             if (err === undefined || err === null) {
                 this.avatar.spriteFrame = new cc.SpriteFrame(texture);
             } else {
-                cc.loader.loadRes('./textures/default_avatar', cc.SpriteFrame, (err, spriteFrame) => {
-                    success(spriteFrame);
-                })
+                console.log(err);
             }
         });
     }