From 00bf17838b496e6fcfed2e521f9c27f8f0e3e3c7 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 05 八月 2024 18:38:20 +0800
Subject: [PATCH] ‘’
---
wechat_staff/components/disRealpic/index.js | 74 ++++++++++++++++++++++++++++++++++--
1 files changed, 69 insertions(+), 5 deletions(-)
diff --git a/wechat_staff/components/disRealpic/index.js b/wechat_staff/components/disRealpic/index.js
index aa2ca72..ea13ece 100644
--- a/wechat_staff/components/disRealpic/index.js
+++ b/wechat_staff/components/disRealpic/index.js
@@ -1,4 +1,5 @@
import { getCataLogTagList, getZhongTaiRealcasePage, actionDo } from '../../api/index'
+let touchDot = 0
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -7,6 +8,10 @@
menuButtonInfo: Object
},
data: {
+ // 鍔ㄧ敾
+ showTouch: true,
+ animationData: {},
+
activeIndex: -1,
activeParam: [],
selParam: '',
@@ -18,13 +23,71 @@
pageNum: 1,
pageSize: 10,
query: '',
- sortType: 'NORMAL',
+ sortType: '',
catalogCode: 'real_case'
},
attached() {
this.getCatelist()
+ this.animation = wx.createAnimation({
+ duration: 600,
+ timingFunction: 'ease',
+ });
},
methods: {
+ bindscrolltoupper() {
+ this.setData({ showTouch: true })
+ this.fadeIn();
+ },
+ touchstart(e){
+ touchDot = e.detail.scrollTop;
+ },
+ touchmove(e) {
+ var touchMove = e.detail.scrollTop;
+ if(touchMove - touchDot > 60){
+ this.fadeOut();
+ }
+ if(touchDot - touchMove > 60){
+ this.fadeIn();
+ this.setData({ showTouch: true })
+ }
+ },
+ fadeIn: function () {
+ this.animation.opacity(1).step();
+ this.setData({
+ animationData: this.animation.export()
+ });
+ },
+ fadeOut: function () {
+ this.animation.opacity(0).step();
+ this.setData({
+ animationData: this.animation.export()
+ });
+ setTimeout(() => {
+ this.setData({ showTouch: false });
+ }, 500); // 鍔ㄧ敾鎸佺画鏃堕棿
+ },
+ 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 +139,7 @@
let videoPlay = this.selectComponent('.videoPlay');
if(videoPlay){
videoPlay.startPlayVideo(videourl,this );
- }
+ }
},
priviewFull(e){
const item = e.currentTarget.dataset.item
@@ -109,9 +172,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({
--
Gitblit v1.9.3