Преглед на файлове

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

SunnyLinSD преди 6 години
родител
ревизия
96b4a9092e
променени са 2 файла, в които са добавени 18 реда и са изтрити 3 реда
  1. 2 2
      assets/prefabs/user_pack_item.prefab
  2. 16 1
      assets/scripts/levelHome/LevelHomePropItem.js

+ 2 - 2
assets/prefabs/user_pack_item.prefab

@@ -382,7 +382,7 @@
     "_enabled": true,
     "_spriteFrame": null,
     "_type": 0,
-    "_sizeMode": 1,
+    "_sizeMode": 0,
     "_fillType": 0,
     "_fillCenter": {
       "__type__": "cc.Vec2",
@@ -391,7 +391,7 @@
     },
     "_fillStart": 0,
     "_fillRange": 0,
-    "_isTrimmedMode": true,
+    "_isTrimmedMode": false,
     "_srcBlendFactor": 770,
     "_dstBlendFactor": 771,
     "_atlas": null

+ 16 - 1
assets/scripts/levelHome/LevelHomePropItem.js

@@ -2,6 +2,7 @@
 const HomeApi = require("../net/HomeApi");
 const DWTool = require("../utils/DWTool");
 const itemList = require('../data/item');
+const GameModule = require("../utils/GameModule");
 
 cc.Class({
     extends: cc.Component,
@@ -46,8 +47,22 @@ cc.Class({
         // this.node.x = 150;
 
         this.node.on(cc.Node.EventType.TOUCH_END, _.debounce(() => {
+            // 上报领取
             HomeApi.itemCollect(this.buildingId, () => {
-
+                // 钻石
+                if(this.propData.id == 10002) {
+                    GameModule.userInfo.updateUserRes({
+                        diamond: this.propData.count 
+                    })
+                }
+
+                // 艺人券
+                if(this.propData.id == 10003) {
+                    GameModule.userInfo.updateUserRes({
+                        ticket: this.propData.count 
+                    })
+                }
+ 
                 this.pickupCallback();
                 let showFrame = this.propSprite.spriteFrame;
                 let showText = `${this.propData.name} x ${this.propData.count}`