Quellcode durchsuchen

fix: handle report detail

wangyuan vor 2 Jahren
Ursprung
Commit
575efe0dc7

+ 7 - 0
pages/index/index.js

@@ -99,6 +99,13 @@ Page({
       url: '/pages/myFile/myFile',
     })
   },
+  // 点击查看报告
+  handleRepoetDetail (e) {
+    var reportid = e.currentTarget.dataset.reportid
+    wx.navigateTo({
+      url: '/pages/reportDetail/reportDetail?reportid=' + reportid
+    })
+  },
   // 添加检测人
   handleAddCheck () {
     wx.navigateTo({

+ 1 - 1
pages/index/index.wxml

@@ -59,7 +59,7 @@
                 <image class="qrcode-item" src="../../imaes/erweima@2x.png"></image>
               </view>
             </view>
-            <view class="file-right check-report">查看报告</view>
+            <view class="file-right check-report" data-reportid="{{item.reportId}}" wx:if="{{item.reportId !== null }}" bindtap="handleRepoetDetail">查看报告</view>
           </view>
         </view>
       </block>

+ 7 - 0
pages/myFile/myFile.js

@@ -59,6 +59,13 @@ Page({
     }
   },
 
+  handleReportDetail (e) {
+    var reportid = e.currentTarget.dataset.reportid
+    wx.navigateTo({
+      url: '/pages/reportDetail/reportDetail?reportid=' + reportid
+    })
+  },
+
   /**
    * 新建档案
    */

+ 2 - 2
pages/myFile/myFile.wxml

@@ -26,8 +26,8 @@
             </view>
           </view>
           <view class="f-right ittflex">
-            <!-- <text class="report-text">已有2份报告</text> -->
-            <text class="report-text report-text-fail">还未产生报告</text>
+            <text class="report-text report-text-success" wx:if="{{item.reportId !== null}}" data-reportid="{{item.reportId}}" bindtap="handleReportDetail">查看报告</text>
+            <text class="report-text report-text-fail" wx:if="{{item.reportId == null}}">还未产生报告</text>
           </view>
         </view>
       </block>

+ 3 - 0
pages/myFile/myFile.wxss

@@ -53,6 +53,9 @@
 .report-text-fail {
   color: #999999;
 }
+.report-text-success {
+  color: var(--maincolor);
+}
 .fu-name {
   font-size: 30rpx;
   font-weight: bold;

+ 0 - 10
pages/report/report.js

@@ -77,18 +77,8 @@ Page({
    */
   handleDetail(e) {
     var reportId = e.currentTarget.dataset.reportid
-    console.log(e.currentTarget.dataset.reportid);
     wx.navigateTo({
       url: '/pages/reportDetail/reportDetail?reportid=' + reportId
     })
-    /* var data = {
-      name: '循环系统',
-      reportId: reportId
-    }
-    getReport(data).then(res => {
-      console.log(res);
-    })
-    return
-     */
   }
 })