Kaynağa Gözat

pref: update report user info

wangyuan 2 yıl önce
ebeveyn
işleme
ac2d83a353
3 değiştirilmiş dosya ile 23 ekleme ve 8 silme
  1. 6 3
      api/my.js
  2. 1 1
      pages/index/index.wxml
  3. 16 4
      pages/reportDetail/reportDetail.js

+ 6 - 3
api/my.js

@@ -5,8 +5,9 @@ import { wxRequest } from './request'
 const bindMobileURL = '/user/bind/mobile' // 获取用户手机号
 const loginURL = '/user/login' // 登录
 const bindBaseInfoURL = '/user/bind/base/info' // 绑定用户头像昵称
-const  myReportListURL =  '/get/my/report/list' // 我的报告
-const  getReportURL =  '/get/report' // 查看我的报告
+const myReportListURL =  '/get/my/report/list' // 我的报告
+const getReportURL =  '/get/report' // 查看我的报告
+const getReportUserInfoURL = '/get/report/user/info'
 const chargeListURL = '/get/charge/list' // 我的充值记录
 const getExaminationOrderListURL = '/get/examination/order/list' // 我的核销记录
 
@@ -22,4 +23,6 @@ export const myReportList =  (data) => wxRequest(myReportListURL, data)
 
 export const getReport =  (data) => wxRequest(getReportURL, data)
 
-export const getExaminationOrderList=  (data) => wxRequest(getExaminationOrderListURL, data)
+export const getExaminationOrderList=  (data) => wxRequest(getExaminationOrderListURL, data)
+
+export const getReportUserInfo =  (data) => wxRequest(getReportUserInfoURL, data)

+ 1 - 1
pages/index/index.wxml

@@ -3,7 +3,7 @@
   <view class="header">
     <view class="main-header">
       <view class="location">
-        <view class="location-info ittflex-jcs" bindtap="openMap">
+        <view class="location-info ittflex-jcs">
           <van-icon name="location" size="20px"/>
           <text class="l-text">{{locationStr}}</text>
         </view>

+ 16 - 4
pages/reportDetail/reportDetail.js

@@ -1,5 +1,5 @@
 // pages/reportDetail/reportDetail.js
-import { getReport } from '../../api/my'
+import { getReport, getReportUserInfo } from '../../api/my'
 Page({
 
   /**
@@ -21,9 +21,21 @@ Page({
    */
   onLoad(options) {
     this.setData({
-      reportId: options.reportid,
-      addTime: options.addTime,
-      realName: options.realName
+      reportId: options.reportid
+    })
+    this.getReportUserInfoFn(options.reportid)
+  },
+
+  // 获取当前报告人的信息
+  getReportUserInfoFn (reportid) {
+    var that = this
+    getReportUserInfo({
+      reportId: reportid
+    }).then(res => {
+      that.setData({
+        addTime: res.data.addTime,
+        realName: res.data.realName
+      })
     })
   },