柒零 1 năm trước cách đây
mục cha
commit
2e5170bd21
2 tập tin đã thay đổi với 23 bổ sung9 xóa
  1. 22 8
      subpages/testSAS/testSAS.js
  2. 1 1
      subpages/testSAS/testSAS.wxml

+ 22 - 8
subpages/testSAS/testSAS.js

@@ -6,21 +6,35 @@ Page({
    * 页面的初始数据
    */
   data: {
-    
+
+  },
+  toSleepEvaluation() {
+    if (!wx.getStorageSync('hotelEmpower') && !wx.getStorageSync('roomEmpower')) {
+      // 无权限 
+      wx.showModal({
+        title: '提示',
+        content: '您不是酒店住客,请联系前台',
+        showCancel: false
+      });
+      return
+    }
+    wx.navigateTo({
+      url: "/subpages/sleepEvaluation/sleepEvaluation"
+    })
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    
+
   },
 
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
   onReady: function () {
-    
+
   },
 
   /**
@@ -33,34 +47,34 @@ Page({
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-    
+
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-    
+
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
-    
+
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-    
+
   },
 
   /**
    * 用户点击右上角分享
    */
   onShareAppMessage: function () {
-    
+
   }
 })

+ 1 - 1
subpages/testSAS/testSAS.wxml

@@ -6,7 +6,7 @@
             <text>睡眠质量指数测评</text>
         </view>
     </navigator>
-    <navigator url="/subpages/sleepEvaluation/sleepEvaluation" class="card-item">
+    <navigator url="null" class="card-item" bindtap="toSleepEvaluation">
         <image class="card-bg" src="/subpages/images/ic_test_bbg.png"></image>
         <view class="card-content">
             <image class="card-icon" src="/subpages/images/ic_test_b.png"></image>