فهرست منبع

fix: bugFix appointment text

wangyuan 2 سال پیش
والد
کامیت
73f088d7ea
7فایلهای تغییر یافته به همراه73 افزوده شده و 25 حذف شده
  1. 1 0
      app.js
  2. 1 0
      pages/buy/buy.js
  3. 0 1
      pages/exchange/exchange.js
  4. 47 21
      pages/index/index.js
  5. 1 0
      pages/my/my.js
  6. 22 2
      pages/report/report.js
  7. 1 1
      pages/set/set.js

+ 1 - 0
app.js

@@ -14,6 +14,7 @@ App({
     })
   },
   globalData: {
+    useNumber: '', // 用户可使用的次数
     accessToken: '',
     isNeedPhone: false, // 是否有号码权限
     isNeedHeadImg: false, // 是否有头像权限

+ 1 - 0
pages/buy/buy.js

@@ -42,6 +42,7 @@ Page({
       that.setData({
         count: res.data
       })
+      app.globalData.useNumber = res.data
     })
   },
 

+ 0 - 1
pages/exchange/exchange.js

@@ -40,7 +40,6 @@ Page({
         mask: true
       })
       userEntityRecharge(data).then(res => {
-        console.log(res, 'userEntityRecharge');
         wx.hideLoading()
         w.showToast({
           title: '充值成功',

+ 47 - 21
pages/index/index.js

@@ -285,6 +285,7 @@ Page({
         documentVos: response,
         isRefreshPage: true
       })
+      app.globalData.useNumber = hoemRes.data.useNumber
     }).catch(e => {
       wx.hideLoading()
       wx.showModal({
@@ -327,7 +328,11 @@ Page({
         })
       break;
       case 1:
-        this.appointmentAuth()
+        if (this.data.showTopBar) {
+          this.stopAppointment()
+        } else {
+          this.appointmentAuth()
+        }
       break;
     }
   },
@@ -375,30 +380,51 @@ Page({
   },
   /*   车子的图片 做跳转交互,跳转做判断,0次则跳出去充值弹框,充值弹窗有两个选择 :若激活卡,则跳转至实体卡兑换页面;若充值,则跳转至体验卡购买页面 */
   handlActions () {
-    if (this.data.useNumber == 0) {
-      wx.showModal({
-        title: '去充值',
-        cancelColor: '#666',
-        cancelText: '激活卡',
-        confirmText: '去充值',
-        confirmColor: '#333',
-        success (res) {
-          if (res.confirm) {
-            wx.navigateTo({
-              url: '/pages/buy/buy?from=index',
-            })
-          } else if (res.cancel) {
-            wx.navigateTo({
-              url: '/pages/exchange/exchange',
-            })
-          }
-        }
-      })
+    if (this.data.showTopBar) {
+      this.stopAppointment()
     } else {
-      this.appointmentAuth()
+      if (this.data.useNumber == 0) {
+        wx.showModal({
+          title: '去充值',
+          cancelColor: '#666',
+          cancelText: '激活卡',
+          confirmText: '去充值',
+          confirmColor: '#333',
+          success (res) {
+            if (res.confirm) {
+              wx.navigateTo({
+                url: '/pages/buy/buy?from=index',
+              })
+            } else if (res.cancel) {
+              wx.navigateTo({
+                url: '/pages/exchange/exchange',
+              })
+            }
+          }
+        })
+      } else {
+        this.appointmentAuth()
+      }
     }
   },
 
+  stopAppointment () {
+    wx.showModal({
+      content: '您预约的健康筛查还未体验,请先体验',
+      cancelColor: '#666',
+      cancelText: '取消',
+      confirmText: '我的预约',
+      confirmColor: '#333',
+      success (res) {
+        if (res.confirm) {
+          wx.navigateTo({
+            url: '/pages/myAppointment/myAppointment',
+          })
+        }
+      }
+    })
+  },
+
   handleShowQRCode (e) {
     var that = this
     var id = e.currentTarget.dataset.id

+ 1 - 0
pages/my/my.js

@@ -139,6 +139,7 @@ Page({
         count: res.data,
         isFirstGetCount: false
       })
+      app.globalData.useNumber = res.data
     })
   },
 

+ 22 - 2
pages/report/report.js

@@ -16,7 +16,6 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow() {
-    console.log('report onshow');
     app.globalData.selectedInex = 1
     this.getMyReportList()
   },
@@ -48,7 +47,28 @@ Page({
    * 立即预约
    */
   handleAppoint() {
-    this.getDocumentList()
+    if (app.globalData.useNumber == 0) {
+      wx.showModal({
+        content: '您当前的检测次数为0,先充值次数',
+        cancelColor: '#666',
+        cancelText: '卡激活',
+        confirmText: '去充值',
+        confirmColor: '#333',
+        success (res) {
+          if (res.confirm) {
+            wx.navigateTo({
+              url: '/pages/buy/buy?from=appointment',
+            })
+          } else if (res.cancel) {
+            wx.navigateTo({
+              url: '/pages/exchange/exchange',
+            })
+          }
+        }
+      })
+    } else {
+      this.getDocumentList()
+    }
   },
 
   /**

+ 1 - 1
pages/set/set.js

@@ -23,7 +23,7 @@ Page({
    */
   handleLinkus() {
     wx.showModal({
-      content: '感谢您选择ITT,如你有疑问,欢迎您拨打打电话:400-,我们的客服人员在早上9点到晚上18点都会在线为您服务',
+      content: '感谢您选择ITT,如你有疑问,欢迎您在公众号【ITT健康扫描】直接留言,我们的客服人员在9:00-18:00在线为您服务',
       confirmColor: '#333',
       showCancel: false
     })