Kaynağa Gözat

fix: bigFixed 2022-10-22-02

wangyuan 2 yıl önce
ebeveyn
işleme
bee0d60c6c

+ 84 - 11
pages/exchange/exchange.js

@@ -1,7 +1,8 @@
 // pages/exchange/exchange.js
+import { documentList } from "../../api/document"
 import { userEntityRecharge } from '../../api/charge'
 import { appGetConfigImg } from '../../api/index'
-
+const app = getApp()
 Page({
 
   /**
@@ -10,7 +11,10 @@ Page({
   data: {
     cardNo: '',
     cardSecret: '',
-    imgUrl: ''
+    imgUrl: '',
+    overlayShow: false,
+    chargestatus: 0,
+    chargetext: ''
   },
 
   onShow () {
@@ -37,6 +41,7 @@ Page({
   handleComfirm() {
     var cardNo = this.data.cardNo
     var cardSecret = this.data.cardSecret
+    var that = this
     console.log(cardNo, cardSecret);
     if (cardNo == '') {
       wx.showToast({
@@ -52,6 +57,7 @@ Page({
       return
     } else {
       var data = {
+        // CARD202010221647 GBISYX
         cardNo: cardNo,
         cardSecret: cardSecret
       }
@@ -61,16 +67,18 @@ Page({
       })
       userEntityRecharge(data).then(res => {
         wx.hideLoading()
-        w.showToast({
-          title: '充值成功',
-          icon: 'success'
+        that.setData({
+          overlayShow: true,
+          chargestatus: 0,
+          chargetext: res.msg
         })
       }).catch(e => {
+        console.log('é',e)
         wx.hideLoading()
-        wx.showModal({
-          content: e,
-          confirmColor: '#333',
-          showCancel: false
+        that.setData({
+          chargestatus: 1,
+          chargetext: e,
+          overlayShow: true
         })
       })
     }
@@ -98,8 +106,73 @@ Page({
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh() {
-
+  reInput() {
+    this.setData({
+      overlayShow: false
+    })
+  },
+    // 立即预约
+    handleAppointment () {
+      this.setData({
+        overlayShow: false
+      })
+      if (app.globalData.hasAppointment) {
+        wx.showModal({
+          content: '您预约的健康筛查还未体验,请先体验',
+          cancelColor: '#666',
+          cancelText: '取消',
+          confirmText: '我的预约',
+          confirmColor: '#333',
+          success (res) {
+            if (res.confirm) {
+              wx.navigateTo({
+                url: '/pages/myAppointment/myAppointment',
+              })
+            }
+          }
+        })
+      } else {
+        this.getDocumentList()
+      }
+    },
+    // 获取用户档案信息
+  getDocumentList () {
+    var that = this
+    wx.showLoading({
+      title: '加载中...',
+      mask: true
+    })
+    documentList({
+      currentPage: 1
+    }).then(res => {
+      wx.hideLoading()
+      const response = res.data.vos || []
+      if (response.length == 0) {
+        wx.showModal({
+          content: '预约用户前需要先添加检测人员信息',
+          cancelColor: '#666',
+          confirmColor: '#333',
+          success (res) {
+            if (res.confirm) {
+              wx.navigateTo({
+                url: '/pages/createFile/createFile?from=index'
+              })
+            }
+          }
+        })
+      } else {
+        wx.navigateTo({
+          url: '/pages/appointment/appointment'
+        })
+      }
+    }).catch(e => {
+      wx.hideLoading()
+      wx.showModal({
+        content: e,
+        confirmColor: '#333',
+        showCancel: false
+      })
+    })
   },
 
   /**

+ 15 - 0
pages/exchange/exchange.wxml

@@ -20,4 +20,19 @@
   <view class="shuoming ittflex">
     <image class="shuomingitem" src="{{imgUrl}}"></image>
   </view>
+  <van-overlay show="{{ overlayShow }}">
+    <view class="wrapper ittflex">
+      <view class="modal">
+        <view class="img-icon ittflex">
+          <image wx:if="{{chargestatus == 0}}" class="success-img imgitem" src="../../imaes/chenggong@2x.png"></image>
+          <image wx:if="{{chargestatus == 1}}" class="fail-img imgitem" src="../../imaes/shibai@2x.png"></image>
+        </view>
+        <view class="res-text">{{chargetext}}</view>
+        <view class="actions ittflex">
+          <button class="itt-btn" wx:if="{{chargestatus == 0}}" bindtap="handleAppointment">立即去预约</button>
+          <button class="itt-btn" wx:if="{{chargestatus == 1}}" bindtap="reInput">重新输入</button>
+        </view>
+      </view> 
+    </view>
+  </van-overlay>
 </view>

+ 27 - 0
pages/exchange/exchange.wxss

@@ -64,4 +64,31 @@
 }
 .shuomingitem {
   width: 100%;
+}
+.wrapper {
+  width: 100%;
+  height: 100%;
+}
+.modal {
+  width: 558rpx;
+  height: 522rpx;
+  background: #FFFFFF;
+  border-radius: 20rpx;
+}
+.img-icon {
+  width: 100%;
+  height: 150rpx;
+  margin-top: 90rpx;
+}
+.imgitem {
+  width: 144rpx;
+  height: 144rpx;
+}
+.res-text {
+  font-size: 26rpx;
+  font-weight: 400;
+  color: #333333;
+  margin: 40rpx auto 40rpx;
+  width: 444rpx;
+  text-align: center;
 }

+ 1 - 1
pages/my/my.wxml

@@ -29,7 +29,7 @@
       </van-grid-item>
     </van-grid>
   </view>
-  <view class="bottom-actions">
+  <view class="bottom-actions" wx:if="{{imageList.length !== 0}}">
     <view class="b-title">小课堂</view>
     <view class="images">
       <image class="imageitem" wx:for="{{imageList}}" wx:key="index" src="{{item.imgUrl}}"></image>

+ 6 - 0
pages/myAppointment/myAppointment.js

@@ -122,6 +122,12 @@ Page({
     })
   },
 
+  handleScanCode () {
+    wx.navigateTo({
+      url: '/pages/myFile/myFile',
+    })
+  },
+
   /**
    * 切换nav
    * 状态 空代表查询全部 ,1:申请(待服务) 2.取消(不做参数) 3.完成

+ 1 - 0
pages/myAppointment/myAppointment.wxml

@@ -31,6 +31,7 @@
         </view>
       </view>
       <view class="bototm actions" wx:if="{{item.status == 1}}">
+        <view class="submit-btn itt-btn ittflex" bindtap="handleScanCode">去核销</view>
         <view class="cancel-button ittflex" bindtap="handleCancel" data-id="{{item.id}}">取消</view>
       </view>
     </view>

+ 8 - 0
pages/myAppointment/myAppointment.wxss

@@ -93,6 +93,14 @@ s-done {
   font-size: 26rpx;
   font-weight: 400;
   color: #333333;
+  box-sizing: border-box;
+}
+.submit-btn {
+  width: 144rpx;
+  height: 60rpx;
+  margin-right: 20rpx;
+  border-radius: 10rpx;
+  font-size: 26rpx;
 }
 .wrapper {
   height: 100%;

+ 8 - 2
pages/reportDetail/reportDetail.js

@@ -8,7 +8,7 @@ Page({
   data: {
     reportid: '',
     name: '评估说明', // 默认展示: 评估说明 小结 ReportTotal, 系统:用具体的中文名称
-    systemName: ['评估说明','检测小结','循环系统', '呼吸系统', '消化系统','泌尿与生殖系统', '血液系统', '内分泌系统', '营养与代谢', '神经系统', '免疫系统', '运动系统', '感官系统', '理化因素', '情绪表格'],
+    systemName: ['评估说明','检测小结','循环系统', '呼吸系统', '消化系统','泌尿系统', '血液系统', '内分泌系统', '营养与代谢', '神经系统', '免疫系统', '运动系统', '感官系统', '理化因素', '情绪压力'],
     leftNavActive: 0, // 0 小结 1 系统
     summaryList: [],
     systemList: [],
@@ -131,8 +131,14 @@ Page({
           name: 'ReportTotal'
         })
       } else {
+        if (navName == '情绪表格') {
+          navName = '精神及心理'
+        }
+        if (navName == '泌尿系统') {
+          navName = '泌尿与生殖系统'
+        }
         that.setData({
-          name: navName == '情绪表格' ? '精神及心理' : navName
+          name: navName
         })
       }
       await that.getReportFn()