From 0e8cc18ee5d35479d30408851c21e5f4c0fb487a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 30 七月 2024 17:00:37 +0800
Subject: [PATCH] 提交
---
wechat_staff/components/disRealpic/index.js | 50 ++++++++++++++++++++++++++++++++------------------
1 files changed, 32 insertions(+), 18 deletions(-)
diff --git a/wechat_staff/components/disRealpic/index.js b/wechat_staff/components/disRealpic/index.js
index 8ffbc56..542bc52 100644
--- a/wechat_staff/components/disRealpic/index.js
+++ b/wechat_staff/components/disRealpic/index.js
@@ -25,6 +25,28 @@
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
@@ -133,28 +156,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