Browse Source

update code

zhuliu 1 year ago
parent
commit
c08fe8abbb

+ 2 - 1
myComponents/product/product.js

@@ -232,6 +232,7 @@ Component({
         api.notify(obj)
         api.notify(obj)
         this.setData({
         this.setData({
           ['tableData['+ index + '].show'] : false,
           ['tableData['+ index + '].show'] : false,
+          ['tableData['+ index + '].ifMonitor'] : true,
         })
         })
         if(type == 0 || type){
         if(type == 0 || type){
           this.setData({
           this.setData({
@@ -257,7 +258,7 @@ Component({
           api.notify(obj)
           api.notify(obj)
           this.setData(
           this.setData(
             {
             {
-              ["tableData["+ index +"].iscon"]:false
+              ["tableData["+ index +"].ifMonitor"]:false
             }
             }
           )
           )
           if(type == 1){
           if(type == 1){

+ 2 - 2
myComponents/product/product.wxml

@@ -21,8 +21,8 @@
       </view>
       </view>
 
 
       <view class="icon">
       <view class="icon">
-        <view wx:if="{{!isFollow && !item.iscon}}" class="iconfont myIconmonitor" data-index="{{index}}" catch:tap="control"></view>
-        <view wx:elif="{{item.iscon && !isFollow}}" class="iconfont myIcona-yijiankong2x" data-index="{{index}}" catch:tap="cancelControl"></view>
+        <view wx:if="{{!isFollow && !item.ifMonitor}}" class="iconfont myIconmonitor" data-index="{{index}}" catch:tap="control"></view>
+        <view wx:elif="{{item.ifMonitor && !isFollow}}" class="iconfont myIcona-yijiankong2x" data-index="{{index}}" catch:tap="cancelControl"></view>
 
 
         <view wx:if="{{item.concernType == 0 || item.concernType}}" class="icon1 iconfont {{concernType[item.concernType]}}" data-index="{{index}}" catch:tap="cancelFollow"></view>
         <view wx:if="{{item.concernType == 0 || item.concernType}}" class="icon1 iconfont {{concernType[item.concernType]}}" data-index="{{index}}" catch:tap="cancelFollow"></view>
         <view wx:else class="iconfont myIconguanzhu" data-index="{{index}}" catch:tap="open"></view>
         <view wx:else class="iconfont myIconguanzhu" data-index="{{index}}" catch:tap="open"></view>

+ 7 - 5
pages/form/addProduct/addProduct.js

@@ -243,11 +243,13 @@ Page({
   updateMessage(params,id){
   updateMessage(params,id){
     var pages = getCurrentPages()
     var pages = getCurrentPages()
     var prepage = pages[pages.length-2]
     var prepage = pages[pages.length-2]
-    var product = {
-      concernType : params.concernType,
-      id:id,
-      key:params.searchCondition,
-      filePath:this.data.fileList[0]?.url
+    var product = prepage.data.product
+    product.concernType = params.concernType
+    product.id = id
+    product.key = params.searchCondition
+    product.filePath = this.data.fileList[0]?.url
+    if(this.data.funType == '监控'){
+      product.ifMonitor = true
     }
     }
     prepage.setData({
     prepage.setData({
       product : product,
       product : product,

+ 1 - 1
pages/monitor/monitor.wxml

@@ -8,7 +8,7 @@
   </view>
   </view>
   <view class="main">
   <view class="main">
     <my-scroll-view  triggered="{{triggered}}" load="{{load}}" hasMore="{{hasMore}}" bindonRefresh="onRefresh" bindloadMore="loadMore" customStyle="height: calc(100vh - 300rpx)">
     <my-scroll-view  triggered="{{triggered}}" load="{{load}}" hasMore="{{hasMore}}" bindonRefresh="onRefresh" bindloadMore="loadMore" customStyle="height: calc(100vh - 300rpx)">
-      <myProduct wx:if="{{tableData.length>0}}" tableData="{{tableData}}"></myProduct>
+      <myProduct wx:if="{{tableData.length>0}}" tableData="{{tableData}}" menu="{{menu}}"></myProduct>
       <van-empty wx:else description="暂无数据" />
       <van-empty wx:else description="暂无数据" />
     </my-scroll-view>
     </my-scroll-view>
     
     

+ 2 - 1
pages/searchResults/searchResults.js

@@ -530,6 +530,7 @@ addMonitoring(product,type){
     this.setData(
     this.setData(
       {
       {
         showDialog:false,
         showDialog:false,
+        ['product.ifMonitor'] : true,
       }
       }
     )
     )
     if(type == 0 || type){
     if(type == 0 || type){
@@ -557,7 +558,7 @@ addMonitoring(product,type){
       api.notify(obj)
       api.notify(obj)
       this.setData(
       this.setData(
         {
         {
-          ["product.iscon"]:false
+          ["product.ifMonitor"]:false
         }
         }
       )
       )
       if(type == 1){
       if(type == 1){

+ 1 - 1
pages/searchResults/searchResults.wxml

@@ -60,7 +60,7 @@
         <view wx:if="{{product.concernType == 0 || product.concernType}}" class="iconfont {{concernType[product.concernType]}}" style="font-size: 50rpx;" catch:tap="cancelFollow"></view>
         <view wx:if="{{product.concernType == 0 || product.concernType}}" class="iconfont {{concernType[product.concernType]}}" style="font-size: 50rpx;" catch:tap="cancelFollow"></view>
         <view wx:else class="iconfont myIconguanzhu" bind:tap="open"></view>
         <view wx:else class="iconfont myIconguanzhu" bind:tap="open"></view>
 
 
-        <view wx:if="{{!product.iscon}}" class="iconfont myIconmonitor" catch:tap="control"></view>
+        <view wx:if="{{!product.ifMonitor}}" class="iconfont myIconmonitor" catch:tap="control"></view>
         <view wx:else class="iconfont myIcona-yijiankong2x" catch:tap="cancelControl"></view>
         <view wx:else class="iconfont myIcona-yijiankong2x" catch:tap="cancelControl"></view>
       </view>
       </view>
     </view>
     </view>