Sfoglia il codice sorgente

Merge branch 'dev4.5' of http://192.168.3.207:8080/qmx/jy into dev4.5

luwenna 4 anni fa
parent
commit
c95a69aa63

+ 11 - 0
src/web/staticres/common-module/collection/js/index-wx.js

@@ -96,6 +96,17 @@ var vNode = {
       var $data = sessionStorage.getItem(this.sessStorageKey)
       if ($data) {
           $data = JSON.parse($data)
+          var listState = $data["listState"];
+          var list = listState["list"];
+          for (var i=0;i<list.length;i++){
+        	if (sessionStorage.getItem('listCollSessionId')&&sessionStorage.getItem('listCollSessionId')==list[i]["_id"]){
+				if (sessionStorage.getItem('listCollSessionBool')=="0"){
+					listState["list"].splice(i,1);
+				}
+   				sessionStorage.removeItem('listCollSessionId')
+   				sessionStorage.removeItem('listCollSessionBool')
+		    }
+	      }
           for (var key in $data) {
               if (excludeKey.indexOf(key) !== -1) {
                   continue

+ 3 - 1
src/web/staticres/common-module/collection/js/index.js

@@ -94,7 +94,9 @@ var vNode = {
           var list = listState["list"];
           for (var i=0;i<list.length;i++){
         	if (sessionStorage.getItem('listCollSessionId')&&sessionStorage.getItem('listCollSessionId')==list[i]["_id"]){
-				listState["list"].splice(i,1);
+				if (sessionStorage.getItem('listCollSessionBool')=="0"){
+					listState["list"].splice(i,1);
+				}
    				sessionStorage.removeItem('listCollSessionId')
    				sessionStorage.removeItem('listCollSessionBool')
 		    }

+ 13 - 1
src/web/staticres/js/wxSupersearch.js

@@ -1989,7 +1989,19 @@ var SuperSearch = {
           }
 			});
 			$("#supersearchPage #list").html(ListContent);
-				//
+			//收藏处理
+			var listCollSessionId = sessionStorage.getItem('listCollSessionId')
+			if (listCollSessionId){
+				var listCollSessionBool = sessionStorage.getItem('listCollSessionBool');
+				if (listCollSessionBool=="1"){
+					$("a[sid='"+listCollSessionId+"']").parent().next().addClass("fill");
+				}else{
+					$("a[sid='"+listCollSessionId+"']").parent().next().removeClass("fill");
+				}
+				sessionStorage.removeItem('listCollSessionId')
+				sessionStorage.removeItem('listCollSessionBool')
+			}
+			//
 			var TableContent=$(sessionStorage.superSearch_tableContent);
 			TableContent.on("tap",function(event){
 			    var h =  $(this).attr("s");

+ 12 - 4
src/web/templates/weixin/historypush.html

@@ -1349,6 +1349,12 @@
               if (countLength > 1) {
                   paddingLeft = (countLength + 1) * 9;
               }
+              //收藏处理
+              if (sessionStorage.getItem('listCollSessionId')&&sessionStorage.getItem('listCollSessionId')==obj["_id"]){
+                obj["collection"] = sessionStorage.getItem('listCollSessionBool');
+        				sessionStorage.removeItem('listCollSessionId')
+        				sessionStorage.removeItem('listCollSessionBool')
+              }
               //是否浏览过
               var visited = "";
               if (obj.ca_isvisit == 1) {
@@ -1969,10 +1975,12 @@
                 tempS.removeClass('hover')
             }, 50)
         })
-        document.querySelector('.screen').addEventListener('touchmove', stopScroll, {passive: false});
-        document.querySelector('.tab_left').addEventListener('touchmove', stopScroll, {passive: false});
-        document.querySelector('.tab_right').addEventListener('touchmove', stopScroll, {passive: false});
-        document.querySelector('.handle_menu').addEventListener('touchmove', stopScroll, {passive: false});
+        try{
+          document.querySelector('.screen').addEventListener('touchmove', stopScroll, {passive: false});
+          document.querySelector('.tab_left').addEventListener('touchmove', stopScroll, {passive: false});
+          document.querySelector('.tab_right').addEventListener('touchmove', stopScroll, {passive: false});
+          document.querySelector('.handle_menu').addEventListener('touchmove', stopScroll, {passive: false});
+        }catch(e){}
         if (firstTime != "" && firstTime != null) {
             date = formatDate(firstTime / 1000, "1");
         }

+ 10 - 0
src/web/templates/weixin/wxinfocontent_rec.html

@@ -2209,10 +2209,20 @@ var vKeepComponent = new Vue({
         },
         changeKeepStatus (type) {
             changeCollectStatus(type)
+            changeListSessionData(type)
         }
     }
 })
 
+//调整列表页收藏状态
+function changeListSessionData(b){
+  sessionStorage.setItem('listCollSessionId', id)
+  sessionStorage.setItem('listCollSessionBool', 0)
+  if(b){
+    sessionStorage.setItem('listCollSessionBool', 1)
+  }
+}
+//
 function changeCollectStatus (f) {
     var $collButton = $('.collec_star')
     var $icon = $collButton.children('.icon')