From 7842252d3e9dd4e5cdb84ed26cd03e0bba6008c1 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 26 七月 2024 10:07:39 +0800
Subject: [PATCH] 提交

---
 wechat_staff/components/buoyClient/index.js                        |   12 ++++--
 wechat_staff/pages/detailDis/product.js                            |   22 +++++++++--
 wechat_staff/utils/config.js                                       |    4 +-
 wechat_staff/pages/detailDis/case.js                               |   12 ++++--
 wechat_staff/api/index.js                                          |    8 ++++
 wechat_staff/pages/kefu/fond.js                                    |    4 ++
 server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java |    1 
 wechat_staff/pages/detailDis/realpic.js                            |   13 +++++-
 wechat_staff/pages/detailDis/product.wxml                          |    2 
 9 files changed, 59 insertions(+), 19 deletions(-)

diff --git a/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java b/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
index 0e4ab81..60517f4 100644
--- a/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
@@ -159,5 +159,4 @@
             e.printStackTrace();
         }
     }
-
 }
diff --git a/wechat_staff/api/index.js b/wechat_staff/api/index.js
index ba78727..73a6bac 100644
--- a/wechat_staff/api/index.js
+++ b/wechat_staff/api/index.js
@@ -324,3 +324,11 @@
     data
   })
 }
+
+export const refreshEnjoy = (obj) =>{
+  let child = obj.selectComponent('.buoyClient');
+  // 璋冪敤瀛愮粍浠朵腑瀹氫箟鐨勬柟娉� 
+  if(child){ 
+    child.freshData();
+  }
+}
\ No newline at end of file
diff --git a/wechat_staff/components/buoyClient/index.js b/wechat_staff/components/buoyClient/index.js
index 738093c..0243535 100644
--- a/wechat_staff/components/buoyClient/index.js
+++ b/wechat_staff/components/buoyClient/index.js
@@ -8,10 +8,10 @@
       type: String,
       value: '0'
     }
-  },
-  attached() {
-    const enjoyList = wx.getStorageSync('enjoyList') || []
-    this.setData({ enjoyList })
+  }, 
+  attached() { 
+      const enjoyList = wx.getStorageSync('enjoyList') || []
+      this.setData({ enjoyList }) 
   },
   /**
    * 缁勪欢鐨勫垵濮嬫暟鎹�
@@ -24,6 +24,10 @@
    * 缁勪欢鐨勬柟娉曞垪琛�
    */
   methods: {
+    freshData() { 
+      const enjoyList = wx.getStorageSync('enjoyList') || []
+      this.setData({ enjoyList }) 
+  },
     jumpPage(e) {
       const urls = [ '/pages/kefu/fond', '/pages/store/staff' ]
       const i = e.currentTarget.dataset.i
diff --git a/wechat_staff/pages/detailDis/case.js b/wechat_staff/pages/detailDis/case.js
index 8c34f7c..8cd8889 100644
--- a/wechat_staff/pages/detailDis/case.js
+++ b/wechat_staff/pages/detailDis/case.js
@@ -1,4 +1,4 @@
-import { actionDo, getWholecaseInfo } from '../../api/index'
+import { actionDo, getWholecaseInfo,refreshEnjoy } from '../../api/index'
 Page({
 
   /**
@@ -50,11 +50,14 @@
   //   }
   // },
   handleEnjoy(e) {
+    const info = this.data.info 
+    if(info.id == null ){
+      return
+    }
     const enjoyList = wx.getStorageSync('enjoyList') || []
     const { type, flag } = e.detail
     console.log('type', type);
-    console.log('flag', flag);
-    const info = this.data.info
+    console.log('flag', flag); 
     if(type == 'enjoy'){
       // 鐐瑰嚮浜嗗枩娆�
       const index = enjoyList.findIndex( i => i.id === info.id )
@@ -72,6 +75,7 @@
         enjoyList.splice(index, 1)
       }
       wx.setStorageSync('enjoyList', enjoyList)
+      refreshEnjoy(this) 
     }else{
       actionDo({
         id: info.id,
@@ -129,7 +133,7 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() {
-
+    refreshEnjoy(this) 
   },
 
   /**
diff --git a/wechat_staff/pages/detailDis/product.js b/wechat_staff/pages/detailDis/product.js
index 0fa8bec..46d697f 100644
--- a/wechat_staff/pages/detailDis/product.js
+++ b/wechat_staff/pages/detailDis/product.js
@@ -1,7 +1,8 @@
 import {
   shareContent,
   getProductInfo,
-  actionDo
+  actionDo,
+  refreshEnjoy
 } from '../../api/index'
 import moment from "moment";
 Page({
@@ -13,7 +14,15 @@
     id: '',
     info: {},
     member: {},
-    showShare: false
+    showShare: false,
+    enjoyList: []
+  },
+  onShow(){
+    console.log('onShow')
+    refreshEnjoy(this)
+  },
+  onHide() {
+    console.log('onHide')
   },
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
@@ -34,13 +43,17 @@
       member
     })
   },
+  
   //  缁勪欢浜嬩欢
   handleEnjoy(e) {
+    const info = this.data.info 
+    if(info.id == null ){
+      return
+    }
     const enjoyList = wx.getStorageSync('enjoyList') || []
     const { type, flag } = e.detail
     console.log('type', type);
-    console.log('flag', flag);
-    const info = this.data.info
+    console.log('flag', flag); 
     if(type == 'enjoy'){
       // 鐐瑰嚮浜嗗枩娆�
       const index = enjoyList.findIndex( i => i.id === info.id )
@@ -58,6 +71,7 @@
         enjoyList.splice(index, 1)
       }
       wx.setStorageSync('enjoyList', enjoyList)
+      refreshEnjoy(this)
     }else{
       actionDo({
         id: info.id,
diff --git a/wechat_staff/pages/detailDis/product.wxml b/wechat_staff/pages/detailDis/product.wxml
index 15b08ec..0f5cd50 100644
--- a/wechat_staff/pages/detailDis/product.wxml
+++ b/wechat_staff/pages/detailDis/product.wxml
@@ -1,5 +1,5 @@
 <view class="main_app">
-  <buoyClient showPurpose="1" />
+  <buoyClient class="buoyClient" showPurpose="1" class="buoyClient"/>
   <detailFooter bindenjoy="handleEnjoy" path="0" info="{{info}}" />
   <!-- banner杞挱 -->
   <swiper class="banner_swiper" circular indicator-dots autoplay style="height:{{bannerHeight}}rpx" duration>
diff --git a/wechat_staff/pages/detailDis/realpic.js b/wechat_staff/pages/detailDis/realpic.js
index dcd361a..ec8517e 100644
--- a/wechat_staff/pages/detailDis/realpic.js
+++ b/wechat_staff/pages/detailDis/realpic.js
@@ -1,4 +1,4 @@
-import { getRealcaseInfo, actionDo } from '../../api/index'
+import { getRealcaseInfo, actionDo ,refreshEnjoy} from '../../api/index'
 Page({
 
   /**
@@ -15,6 +15,9 @@
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
    */
+  onShow(){
+    refreshEnjoy(this) 
+  },
   onLoad(options) {
     var app = getApp().globalData
     this.setData({
@@ -43,11 +46,14 @@
     })
   },
   handleEnjoy(e) {
+    const info = this.data.info 
+    if(info.id == null ){
+      return
+    }
     const enjoyList = wx.getStorageSync('enjoyList') || []
     const { type, flag } = e.detail
     console.log('type', type);
-    console.log('flag', flag);
-    const info = this.data.info
+    console.log('flag', flag); 
     if(type == 'enjoy'){
       // 鐐瑰嚮浜嗗枩娆�
       const index = enjoyList.findIndex( i => i.id === info.id )
@@ -65,6 +71,7 @@
         enjoyList.splice(index, 1)
       }
       wx.setStorageSync('enjoyList', enjoyList)
+      refreshEnjoy(this) 
     }else{
       actionDo({
         id: info.id,
diff --git a/wechat_staff/pages/kefu/fond.js b/wechat_staff/pages/kefu/fond.js
index 789e2eb..814ef7e 100644
--- a/wechat_staff/pages/kefu/fond.js
+++ b/wechat_staff/pages/kefu/fond.js
@@ -24,6 +24,7 @@
       item.checked = false
     })
     wx.setStorageSync('enjoyList', enjoyList)
+    console.log(this.data.enjoyList)
     this.initData()
   },
 
@@ -65,6 +66,7 @@
       }
     })
     wx.setStorageSync('enjoyList', enjoyList)
+   
     this.initData()
   },
   itemClick(e) {
@@ -178,6 +180,7 @@
             }
           })
           wx.setStorageSync('enjoyList', enjoyListTemp)
+          
           that.initData()
         }
       }
@@ -190,6 +193,7 @@
       item.checked = !item.checked
     })
     wx.setStorageSync('enjoyList', enjoyList)
+    
     this.initData()
   },
   openShare() {
diff --git a/wechat_staff/utils/config.js b/wechat_staff/utils/config.js
index e672602..a150c8d 100644
--- a/wechat_staff/utils/config.js
+++ b/wechat_staff/utils/config.js
@@ -1,5 +1,5 @@
-// export const baseUrl = 'http://192.168.0.135:10027' 
-export const baseUrl = 'https://dmtest.ahapp.net/web_interface' // 鏈湴
+export const baseUrl = 'http://192.168.0.135:10027' 
+// export const baseUrl = 'https://dmtest.ahapp.net/web_interface' // 鏈湴
 // export const baseUrl = 'http://zbtest.ahapp.net/zbom_interface/jx/wechat/' //娴嬭瘯鏈嶅姟鍣�
 
 // export const imageUrl = 'https://osswebcdn.zbom.com/jiaxuan/images/'

--
Gitblit v1.9.3