From 7dc29ed74ebaa8a0e66f68264d9a13f95dc3af21 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 02 八月 2024 11:09:06 +0800
Subject: [PATCH] aa

---
 wechat_staff/components/disRealpic/index.js |   59 +++++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/wechat_staff/components/disRealpic/index.js b/wechat_staff/components/disRealpic/index.js
index 8ffbc56..c05e2e9 100644
--- a/wechat_staff/components/disRealpic/index.js
+++ b/wechat_staff/components/disRealpic/index.js
@@ -18,13 +18,35 @@
     pageNum: 1,
     pageSize: 10,
     query: '',
-    sortType: 'NORMAL',
+    sortType: '',
     catalogCode: 'real_case'
   },
   attached() {
     this.getCatelist()
   },
   methods: {
+    refreshCount(){    
+      let  temData = wx.getStorageSync('conentCountTemp')   
+      if(temData && this.data.dataList){  
+          var dataList =this.data.dataList;
+          dataList.forEach(item =>{ 
+              if(item.id+'' == temData.id+'' ){
+                  item.viewCount = (item.viewCount ||0)+1; 
+                  if( item.isCollection != temData.isCollection){ 
+                    if(item.isCollection){
+                        item.collectCount = (item.collectCount || 0)-1
+                        item.collectCount  =   item.collectCount >=0?  item.collectCount :0;
+                    } else{ 
+                        item.collectCount = (item.collectCount || 0)+1
+                    }
+                    item.isCollection = temData.isCollection
+                }
+              }   
+          })
+          this.setData({dataList:dataList})
+           wx.setStorageSync('conentCountTemp',null)
+      }
+    },
     getCatelist(){
       const { catalogCode } = this.data
       getCataLogTagList({
@@ -73,9 +95,10 @@
     },
     videoClick(e) {
       const { videourl } = e.currentTarget.dataset
-      wx.previewMedia({
-        sources: [{ url: videourl, type: 'video' }]
-      })
+      let videoPlay = this.selectComponent('.videoPlay'); 
+      if(videoPlay){ 
+        videoPlay.startPlayVideo(videourl,this );
+      } 
     },
     priviewFull(e){
       const item = e.currentTarget.dataset.item
@@ -108,9 +131,10 @@
       const item = e.currentTarget.dataset.item
       console.log('item', item);
       if(item.openType == 'video'){
-        wx.previewMedia({
-          sources: [{ url: item.openContent, type: 'video' }]
-        })
+        let videoPlay = this.selectComponent('.videoPlay'); 
+        if(videoPlay){ 
+          videoPlay.startPlayVideo(item.openContent,this );
+        } 
       }
       if(item.openType == 'link'){
         wx.navigateTo({
@@ -133,28 +157,19 @@
       }
       const code = e.currentTarget.dataset.code
       const paramIndex = e.currentTarget.dataset.index
-      const { cateList, tagCodes, activeParam, activeIndex } = this.data
-      const index = tagCodes.indexOf(code)
-      
-      if(index === -1){
-        // if(activeParam && activeParam.length > 0){
-        //   activeParam.forEach(item => {
-        //     const indexTemp = tagCodes.indexOf(item.labelValueCode)
-        //     if(indexTemp > -1){
-        //       tagCodes.splice(indexTemp, 1)
-        //     }
-        //   })
-        // }
-        // tagCodes.push(code)
+      const { cateList, tagCodes, activeParam, activeIndex } = this.data 
+      if(   cateList[activeIndex].tempParamIndex==null ||     cateList[activeIndex].tempParamIndex != paramIndex){ 
         cateList[activeIndex].tempParamIndex = paramIndex
         cateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName
         cateList[activeIndex].tempParamCode = code
+        console.log(code)
       }else{
         cateList[activeIndex].tempParamIndex = -1
         cateList[activeIndex].tempParamName = null
-        cateList[activeIndex].tempParamCode = null
+        cateList[activeIndex].tempParamCode = null 
+        console.log(1)
       }
-      this.setData({  cateList })
+      this.setData({  cateList }) 
     },
     cancelParam() {
       const { cateList } = this.data

--
Gitblit v1.9.3