From 86fc8bbb09df7bbeb50fa714ff8bb4aea85ffef5 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 29 七月 2024 15:57:17 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 wechat_jiaxuan/components/disRealpic/index.js |   45 +++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/wechat_jiaxuan/components/disRealpic/index.js b/wechat_jiaxuan/components/disRealpic/index.js
index e836e5e..de55855 100644
--- a/wechat_jiaxuan/components/disRealpic/index.js
+++ b/wechat_jiaxuan/components/disRealpic/index.js
@@ -4,7 +4,7 @@
    * 缁勪欢鐨勫睘鎬у垪琛�
    */
   properties: {
-
+    menuButtonInfo: Object
   },
   data: {
     activeIndex: -1,
@@ -18,7 +18,7 @@
     pageNum: 1,
     pageSize: 10,
     query: '',
-    sortType: 'NORMAL',
+    sortType: '',
     catalogCode: 'real_case'
   },
   attached() {
@@ -45,8 +45,28 @@
       getZhongTaiRealcasePage({
         catalogCode,tagCodes,pageNum,pageSize, sortType,query
       }).then(res => {
-        this.setData({ dataList: res.data.records })
+        this.setData({
+          dataList: [...this.data.dataList, ...res.data.records],
+          total: res.data.total,
+        })
       })
+    },
+    scrolltoupper() {
+      this.setData({ pageNum: 1,datalist: [],total: 0})
+      this.getList()
+    },
+    scrolltolower() {
+      console.log('瑙﹀簳浜嬩欢');
+      const { total, dataList, pageNum } = this.data
+      if(total > dataList.length){
+        this.setData({ pageNum: pageNum + 1 })
+        this.getList()
+      }else{
+        wx.showToast({
+          title: '鏆傛棤鏇村鏁版嵁',
+          icon: 'none'
+        })
+      }
     },
     videoClick(e) {
       const { videourl } = e.currentTarget.dataset
@@ -68,6 +88,7 @@
     statusChange(e) {
       const sortType = e.currentTarget.dataset.status
       this.setData({sortType})
+      this.setData({ pageNum: 1,dataList: [],total: 0})
       this.getList()
     },
     handleAction(e){
@@ -91,6 +112,10 @@
       if(item.openType == 'link'){
         wx.navigateTo({
           url: '/pages/webView/index?link=' + item.openContent,
+          success: function(res) {
+            // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+            res.eventChannel.emit('acceptDataFromOpenerPage', { link: item.openContent})
+          }
         })
       }
       if(item.openType == 'page'){
@@ -106,6 +131,14 @@
       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)
         cateList[activeIndex].paramIndex = paramIndex
         cateList[activeIndex].paramName = activeParam[paramIndex].labelValueName
@@ -114,6 +147,7 @@
         cateList[activeIndex].paramIndex = -1
         cateList[activeIndex].paramName = ''
       }
+      this.setData({ pageNum: 1,dataList: [],total: 0})
       this.setData({ tagCodes, cateList })
       console.log('tagCodes', tagCodes);
     },
@@ -123,13 +157,16 @@
         item.paramIndex = -1
         item.paramName = ''
       })
-      this.setData({ tagCodes: [],activeParam: [],cateList,activeIndex: -1 })
+      this.setData({ tagCodes: [],datalist:[],pageNum:1, activeParam: [],cateList,activeIndex: -1 })
+      this.getList()
     },
     bindblur() {
+      this.setData({ pageNum: 1,dataList: [],total: 0})
       this.getList()
     },
     subParam() {
       this.setData({ activeParam: [] })
+      this.setData({ pageNum: 1,activeIndex: -1,dataList: [],total: 0})
       this.getList()
     },
     changeShowParams(e){

--
Gitblit v1.9.3