Kaynağa Gözat

feat: add examination order list

wangyuan 2 yıl önce
ebeveyn
işleme
25fd85d497

+ 4 - 1
api/my.js

@@ -8,6 +8,7 @@ const bindBaseInfoURL = '/user/bind/base/info' // 绑定用户头像昵称
 const  myReportListURL =  '/get/my/report/list' // 我的报告
 const  getReportURL =  '/get/report' // 查看我的报告
 const chargeListURL = '/get/charge/list' // 我的充值记录
+const getExaminationOrderListURL = '/get/examination/order/list' // 我的核销记录
 
 export const ittLogin =  (data) => wxRequest(loginURL, data)
 
@@ -19,4 +20,6 @@ export const chargeList =  (data) => wxRequest(chargeListURL, data)
 
 export const myReportList =  (data) => wxRequest(myReportListURL, data)
 
-export const getReport =  (data) => wxRequest(getReportURL, data)
+export const getReport =  (data) => wxRequest(getReportURL, data)
+
+export const getExaminationOrderList=  (data) => wxRequest(getExaminationOrderListURL, data)

+ 1 - 1
app.json

@@ -38,7 +38,7 @@
   "window": {
     "backgroundTextStyle": "light",
     "navigationBarBackgroundColor": "#45A6B5",
-    "navigationBarTitleText": "ITT健康检测",
+    "navigationBarTitleText": "ITTHealth",
     "navigationBarTextStyle": "white",
     "backgroundColor": "#45A6B5"
   },

+ 1 - 0
pages/my/my.js

@@ -69,6 +69,7 @@ Page({
         id: 6,
         title: '设置',
         url: '/pages/set/set?form=my',
+        //url: '/pages/buy/buy?form=my',
         imgUrl: '../../imaes/shezhi@2x.png'
       }
     ]

+ 32 - 44
pages/myRecord/myRecord.js

@@ -1,5 +1,5 @@
 // pages/myRecord/myRecord.js
-import { chargeList } from "../../api/my";
+import { chargeList, getExaminationOrderList } from "../../api/my";
 Page({
 
   /**
@@ -13,20 +13,6 @@ Page({
     hasNext: false
   },
 
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad(options) {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady() {
-
-  },
-
   /**
    * 生命周期函数--监听页面显示
    */
@@ -62,6 +48,31 @@ Page({
     })
   },
 
+  // 获取核销记录
+  getExaminationOrderListFn () {
+    var data = {
+      currentPage: this.data.currentPage
+    }
+    wx.showLoading({
+      title: '加载中...',
+      mask: true
+    })
+    getExaminationOrderList(data).then(res => {
+      wx.hideLoading()
+      this.setData({
+        hasNext: res.data.hasNext,
+        destoryRecordList: res.data.vos
+      })
+    }).catch(e => {
+      wx.hideLoading()
+      wx.showModal({
+        content: e,
+        confirmColor: '#333',
+        showCancel: false
+      })
+    })
+  },
+
   onReachBottom () {
     if (this.data.hasNext) {
       var _currentPag = this.data.currentPage + 1
@@ -70,6 +81,8 @@ Page({
       })
       if (this.data.navItemActive == 0) {
         this.getChargeList()
+      } else {
+        this.getExaminationOrderListFn()
       }
     }
   },
@@ -81,38 +94,13 @@ Page({
     var navItemActive = e.currentTarget.dataset.index
     this.setData({
       navItemActive: navItemActive,
-      currentPage: 1
+      currentPage: 1,
+      hasNext: false
     })
     if (navItemActive == 0) {
       this.getChargeList()
+    } else {
+      this.getExaminationOrderListFn()
     }
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload() {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom() {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage() {
-
   }
 })

+ 1 - 1
pages/myRecord/myRecord.json

@@ -1,3 +1,3 @@
 {
-  "usingComponents": {}
+  "navigationBarTitleText": "我的记录"
 }

+ 24 - 10
pages/myRecord/myRecord.wxml

@@ -6,6 +6,7 @@
       <view class="nav-item nav-wait ittflex {{navItemActive == '1' ? 'nav-item-active' : ''}}" bindtap="handleChangeNav" data-index="1">核销记录</view>
     </view>
   </block>
+  <!-- 充值记录 -->
   <block wx:if="{{navItemActive == '0'}}">
     <view class="charge-record record-main">
       <block wx:if="{{chargeRecordList.length == 0}}">
@@ -35,11 +36,12 @@
               <text>{{item.addTime}}</text>
             </view>
           </view>
-          <view class="right count">+{{item.useNumber}}</view>
+          <view class="right count">{{item.useNumber}}</view>
         </view>
       </block>
     </view>
   </block>
+  <!-- 核销记录 -->
   <block wx:if="{{navItemActive == '1'}}">
     <view class="destory-record record-main">
       <block wx:if="{{destoryRecordList.length == 0}}">
@@ -48,19 +50,31 @@
         </view>
       </block>
       <block wx:if="{{destoryRecordList.length !== 0}}">
-        <view class="record-item ittflex-jcs" wx:for="{{destoryRecordList}}" wx:key="index">
-          <view class="left icon">
-          <!--  <image class="image" src="../../imaes/shiti@2x.png"></image> -->
-            <image class="image" src="../../imaes/baogao_sel@2x.png"></image>
+        <view class="des-record-item ittflex-jcs" wx:for="{{destoryRecordList}}" wx:key="index">
+          <view class="item-left img">
+            <image class="img-item" src="../../imaes/baogao_sel@2x.png"></image>
           </view>
-          <view class="center info">
-            <view class="title info-item">体验核销成功</view>
-            <view class="time info-item">
+          <view class="item-center">
+          <!-- 状态 0:已核销 1:待体检(输入核销码)  2:体检完成 (体检报告检出) -->
+            <view class="item-status">
+              <text wx:if="{{item.status == 0}}">已核销</text>
+              <text wx:if="{{item.status == 1}}">待体检</text>
+              <text wx:if="{{item.status == 2}}">体检完成</text>
+            </view>
+            <view class="real-name stitle">
+              <text>体检人:</text>
+              <text>{{item.realName}}</text>
+            </view>
+            <view class="order-code stitle">
+              <text>核销码:</text>
+              <text>{{item.orderCode}}</text>
+            </view>
+            <view class="add-time stitle">
               <text>核销时间:</text>
-              <text>2022-10-10 22:22</text>
+              <text>{{item.addTime}}</text>
             </view>
           </view>
-          <view class="right count">+199</view>
+          <view class="item-right">-1</view>
         </view>
       </block>
     </view>

+ 44 - 0
pages/myRecord/myRecord.wxss

@@ -67,4 +67,48 @@
   font-weight: 400;
   color: var(--maincolor);
   margin-right: 20rpx;
+}
+
+.des-record-item {
+  width: 690rpx;
+  height: 234rpx;
+  background: #FFFFFF;
+  border-radius: 20rpx;
+  margin: 20rpx auto 0;
+  align-items: flex-start;
+}
+.item-left {
+  width: 80rpx;
+  height: 100%;
+  margin: 0 20rpx;
+}
+.img-item {
+  width: 100%;
+  height: 80rpx;
+  margin-top: 32rpx;
+}
+.item-center {
+  width: 420rpx;
+  height: 100%;
+}
+.item-status {
+  font-size: 26rpx;
+  font-weight: 400;
+  color: #333333;
+  margin-top: 30rpx;
+}
+.stitle {
+  font-size: 26rpx;
+  font-weight: 400;
+  color: #999999;
+  margin-top: 10rpx;
+}
+.item-right {
+  font-size: 26rpx;
+  font-weight: 400;
+  color: #45A6B5;
+  text-align: right;
+  width: 130rpx;
+  padding-right: 20rpx;
+  margin-top: 30rpx;
 }