浏览代码

Merge branch '0.6' of http://svn.ouj.com:3000/DWG/allstar into 0.6

SunnyLinSD 6 年之前
父节点
当前提交
0092689bf4

+ 4 - 4
assets/resources/prefabs/change_job.prefab

@@ -2388,7 +2388,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 400,
+      "width": 500,
       "height": 850
     },
     "_rotationX": 0,
@@ -4274,7 +4274,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 94,
+      "width": 90,
       "height": 40
     },
     "_rotationX": 0,
@@ -4381,7 +4381,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 4,
+      "width": 0,
       "height": 50
     },
     "_rotationX": 0,
@@ -5708,7 +5708,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 54,
+      "width": 52,
       "height": 30
     },
     "_rotationX": 0,

+ 5 - 5
assets/scripts/job/ChangeJob.js

@@ -79,13 +79,12 @@ cc.Class({
         this.user.active = false;
         this.pageView.node.active = true;
         this.levelUpNode.active = false;
-        this.pageView.getComponent('PVCtrl').bind(this.actorInfo.jobId, this.actorInfo.gender);
+        this.pageViewScript = this.pageView.getComponent('PVCtrl');
+        this.pageViewScript.bind(this.actorInfo.jobId, this.actorInfo.gender);
 
         this.titleText.string = '<b>职业转换</b>';
         this.confirmText.string = '<outline color=#690802 width=1><b>转职</b></outline>';
 
-        this.pageViewScript = this.pageView.getComponent('PVCtrl');
-
         JobApi.changeJobList(this.actorInfo.uid,
             (response) => {
                 this.userPack = response.userPack;
@@ -115,12 +114,12 @@ cc.Class({
         this.user.active = true;
         this.pageView.node.active = true;
         this.levelUpNode.active = false;
-        this.pageView.getComponent('PVCtrl').bind(0, this.actorInfo.gender);
+        this.pageViewScript = this.pageView.getComponent('PVCtrl');
+        this.pageViewScript.bind(0, this.actorInfo.gender);
 
         this.titleText.string = '<b>选择职业</b>';
         this.confirmText.string = '<outline color=#690802 width=1><b>确定</b></outline>';
 
-        this.pageViewScript = this.pageView.getComponent('PVCtrl');
         this.pageViewScript.bindSelectedJobText();
         this.bindChooseJob(this.actorInfo);
     },
@@ -242,6 +241,7 @@ cc.Class({
     },
 
     bindChooseJob() {
+        this.pageViewScript.bind(0, this.actorInfo.gender);
         this.user.getComponent('Actor').bind(this.actorInfo);
     },
 

+ 15 - 15
assets/scripts/job/PVCtrl.js

@@ -30,21 +30,6 @@ cc.Class({
             let item = cc.instantiate(this.jobItem);
             item.active = true;
             item.position = new cc.p(0, 0);
-            item.getComponent('JobItem').bind(this.jobList[i]);
-            this.pageview.addPage(item);
-        }
-        ///动态添加item的时候必须加这两行代码,刷新PageView的各种数值参数,让界面正常显示
-        this.pageview.sizeMode = cc.PageView.SizeMode.Free;
-        this.pageview._updatePageView();
-    },
-
-    bindJobList(jobList) {
-        this.pageview.removeAllPages();
-        this.jobList = jobList;
-        for (var i = 0; i < this.jobList.length; i++) {
-            let item = cc.instantiate(this.jobItem);
-            item.active = true;
-            item.position = new cc.p(0, 0);
             item.getComponent('JobItem').bind(this.jobList[i], this.gender);
             this.pageview.addPage(item);
         }
@@ -53,6 +38,21 @@ cc.Class({
         this.pageview._updatePageView();
     },
 
+    // bindJobList(jobList) {
+    //     this.pageview.removeAllPages();
+    //     this.jobList = jobList;
+    //     for (var i = 0; i < this.jobList.length; i++) {
+    //         let item = cc.instantiate(this.jobItem);
+    //         item.active = true;
+    //         item.position = new cc.p(0, 0);
+    //         item.getComponent('JobItem').bind(this.jobList[i], this.gender);
+    //         this.pageview.addPage(item);
+    //     }
+    //     ///动态添加item的时候必须加这两行代码,刷新PageView的各种数值参数,让界面正常显示
+    //     this.pageview.sizeMode = cc.PageView.SizeMode.Free;
+    //     this.pageview._updatePageView();
+    // },
+
     bindSelectedJobText() {
         let jobInfo = this.jobList[this.pageview.getCurrentPageIndex()];
         this.artistIconSprite.spriteFrame = this.jobIconFrames[jobInfo.id - 1];

+ 9 - 3
assets/scripts/net/Api.js

@@ -24,13 +24,17 @@ class Api {
                             success(new cc.SpriteFrame(texture))
                         } catch (e) {
                             cc.log(e);
-                            fail();
+                            cc.loader.loadRes('./textures/default_avatar', cc.SpriteFrame, (err, spriteFrame) => {
+                                success(spriteFrame);
+                            })
                         }
                     };
                     image.src = avatarUrl;
                 } catch (e) {
                     cc.log(e);
-                    fail();
+                    cc.loader.loadRes('./textures/default_avatar', cc.SpriteFrame, (err, spriteFrame) => {
+                        success(spriteFrame);
+                    })
                 }
             } else {
                 cc.loader.load({
@@ -39,7 +43,9 @@ class Api {
                     if (err === undefined || err === null) {
                         success(new cc.SpriteFrame(texture));
                     } else {
-                        fail();
+                        cc.loader.loadRes('./textures/default_avatar', cc.SpriteFrame, (err, spriteFrame) => {
+                            success(spriteFrame);
+                        })
                     }
                 });
             }

+ 1 - 1
assets/scripts/notice/ToastCtrl.js

@@ -8,7 +8,7 @@ cc.Class({
 
     onLoad() {
         this.node.on(cc.Node.EventType.TOUCH_END, () => {
-            this.close();
+            // this.close();
         });
     },
 

+ 1 - 1
assets/scripts/userInformation/UserInteraction.js

@@ -343,7 +343,7 @@ cc.Class({
     //消耗钻石加速CD时间
     speedCDAction() {
         UserInformationApi.postSpeedInteraction(this.uid, (responseData) => {
-            this.interactionInfo.cnt += 1;
+            this.interactionInfo.cnt = responseData.cnt;
             this.interactionInfo.cdEnd = 0;
             GameModule.userInfo.diamond -= 20;
             this.showInteraction();