|
|
@@ -1158,6 +1158,28 @@ cc.Class({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ //一键偷菜按钮调用
|
|
|
+ onOtherStealAllFunction(){
|
|
|
+ this.onStealAllFruit({otherUserId:GlobalD.OtherUserInfo.userId},(value)=>{
|
|
|
+ console.log(value);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //一键收取果实,偷取
|
|
|
+ onStealAllFruit(data, callback) {
|
|
|
+ if (this.isOnAddFruit) {
|
|
|
+ console.log("一键收取果实过快!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.isOnAddFruit = true;
|
|
|
+ utils.post(utils.api.stealAllFruit, data, (flag, value) => {
|
|
|
+ this.isOnAddFruit = false;
|
|
|
+ if (flag)
|
|
|
+ callback(value);
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
//偷取用户果实
|
|
|
onStealFruit(data, callback) {
|
|
|
if (this.isOnAddFruit) {
|