|
@@ -2,6 +2,7 @@
|
|
const HomeApi = require("../net/HomeApi");
|
|
const HomeApi = require("../net/HomeApi");
|
|
const DWTool = require("../utils/DWTool");
|
|
const DWTool = require("../utils/DWTool");
|
|
const itemList = require('../data/item');
|
|
const itemList = require('../data/item');
|
|
|
|
+const GameModule = require("../utils/GameModule");
|
|
|
|
|
|
cc.Class({
|
|
cc.Class({
|
|
extends: cc.Component,
|
|
extends: cc.Component,
|
|
@@ -46,8 +47,22 @@ cc.Class({
|
|
// this.node.x = 150;
|
|
// this.node.x = 150;
|
|
|
|
|
|
this.node.on(cc.Node.EventType.TOUCH_END, _.debounce(() => {
|
|
this.node.on(cc.Node.EventType.TOUCH_END, _.debounce(() => {
|
|
|
|
+ // 上报领取
|
|
HomeApi.itemCollect(this.buildingId, () => {
|
|
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();
|
|
this.pickupCallback();
|
|
let showFrame = this.propSprite.spriteFrame;
|
|
let showFrame = this.propSprite.spriteFrame;
|
|
let showText = `${this.propData.name} x ${this.propData.count}`
|
|
let showText = `${this.propData.name} x ${this.propData.count}`
|