From 744c16a15432461394e1e2dbdfaea34a766fcc6b Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 01 八月 2024 08:53:29 +0800
Subject: [PATCH] ‘’
---
wechat_staff/components/disRealpic/index.js | 52 +++++++++++++++++++++++++++++++++-------------------
1 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/wechat_staff/components/disRealpic/index.js b/wechat_staff/components/disRealpic/index.js
index 928b214..e1ffb3c 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({
@@ -76,7 +98,7 @@
let videoPlay = this.selectComponent('.videoPlay');
if(videoPlay){
videoPlay.startPlayVideo(videourl,this );
- }
+ }
},
priviewFull(e){
const item = e.currentTarget.dataset.item
@@ -109,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({
@@ -134,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