shawenguan 1 ano atrás
pai
commit
6c1e6bf7ac
2 arquivos alterados com 44 adições e 3 exclusões
  1. 22 2
      Scripts/hbcpre/hbcpreComposite.js
  2. 22 1
      Scripts/hbcpre/hbcpreExchange.js

+ 22 - 2
Scripts/hbcpre/hbcpreComposite.js

@@ -116,8 +116,28 @@ function getActivitDataCache(eventsType, eventsId){
     return data;
 }
 
-function saveActivitDataCache(eventsType, actData){
-    magicJS.logger.error(JSON.stringify(actData));
+function saveActivitDataCache(eventsType, actData, eventsId){
+    if(!actData){
+        if(!eventsId){
+            return;
+        }
+        let data = null;
+        let storeKey = null;
+        if(eventsType == 1){
+            storeKey = HbcpreConstKey.compositeActivityData;
+        }else if(eventsType == 3){
+            storeKey = HbcpreConstKey.exchangeActivityData;
+        }
+        if(!storeKey){
+            data = {};
+        }else{
+            data = magicJS.data.read(storeKey, {});
+        }
+        if(eventsId){
+            data[eventsId] = null;
+        }
+        return;
+    }
     let data = null;
     let storeKey = null;
     if(eventsType == 1){

+ 22 - 1
Scripts/hbcpre/hbcpreExchange.js

@@ -116,7 +116,28 @@ function getActivitDataCache(eventsType, eventsId){
     return data;
 }
 
-function saveActivitDataCache(eventsType, actData){
+function saveActivitDataCache(eventsType, actData, eventsId){
+    if(!actData){
+        if(!eventsId){
+            return;
+        }
+        let data = null;
+        let storeKey = null;
+        if(eventsType == 1){
+            storeKey = HbcpreConstKey.compositeActivityData;
+        }else if(eventsType == 3){
+            storeKey = HbcpreConstKey.exchangeActivityData;
+        }
+        if(!storeKey){
+            data = {};
+        }else{
+            data = magicJS.data.read(storeKey, {});
+        }
+        if(eventsId){
+            data[eventsId] = null;
+        }
+        return;
+    }
     let data = null;
     let storeKey = null;
     if(eventsType == 1){