柒零 1 gadu atpakaļ
vecāks
revīzija
2fb3ed8378
35 mainītis faili ar 3028 papildinājumiem un 579 dzēšanām
  1. 8 23
      @vant/weapp/nav-bar/index.wxml
  2. 5 1
      app.json
  3. 22 1
      project.private.config.json
  4. 210 0
      subpages/evaluationIntroduction/evaluationIntroduction.js
  5. 7 0
      subpages/evaluationIntroduction/evaluationIntroduction.json
  6. 46 0
      subpages/evaluationIntroduction/evaluationIntroduction.wxml
  7. 232 0
      subpages/evaluationIntroduction/evaluationIntroduction.wxss
  8. BIN
      subpages/images/testRes/ic_test_desc_bg.png
  9. BIN
      subpages/images/testRes/ic_test_desc_bg_tz.png
  10. BIN
      subpages/images/testRes/ic_test_dot.png
  11. BIN
      subpages/images/testRes/ic_test_man.png
  12. BIN
      subpages/images/testRes/ic_test_man_check.png
  13. BIN
      subpages/images/testRes/ic_test_member.png
  14. BIN
      subpages/images/testRes/ic_test_right.png
  15. BIN
      subpages/images/testRes/ic_test_share.png
  16. BIN
      subpages/images/testRes/ic_test_share_ad.png
  17. BIN
      subpages/images/testRes/ic_test_size.png
  18. BIN
      subpages/images/testRes/ic_test_time.png
  19. BIN
      subpages/images/testRes/ic_test_women.png
  20. BIN
      subpages/images/testRes/ic_test_women_check.png
  21. 0 15
      subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment.js
  22. 154 0
      subpages/testResultA/testResultA.js
  23. 4 0
      subpages/testResultA/testResultA.json
  24. 52 0
      subpages/testResultA/testResultA.wxml
  25. 214 0
      subpages/testResultA/testResultA.wxss
  26. 134 0
      subpages/testResultB/testResultB.js
  27. 4 0
      subpages/testResultB/testResultB.json
  28. 39 0
      subpages/testResultB/testResultB.wxml
  29. 188 0
      subpages/testResultB/testResultB.wxss
  30. 4 2
      subpages/testSAS/testSAS.js
  31. 1305 0
      subpages/textStep/textStep.js
  32. 4 0
      subpages/textStep/textStep.json
  33. 119 0
      subpages/textStep/textStep.wxml
  34. 277 0
      subpages/textStep/textStep.wxss
  35. 0 537
      typings/wx.d.ts

+ 8 - 23
@vant/weapp/nav-bar/index.wxml

@@ -3,25 +3,14 @@
 
 <view wx:if="{{ fixed && placeholder }}" style="height: {{ height }}px;" />
 
-<view
-  class="{{ utils.bem('nav-bar', { fixed }) }} custom-class {{ border ? 'van-hairline--bottom' : '' }}"
-  style="{{ computed.barStyle({ zIndex, statusBarHeight, safeAreaInsetTop }) }}; {{ customStyle }}"
->
+<view class="{{ utils.bem('nav-bar', { fixed }) }} custom-class {{ border ? 'van-hairline--bottom' : '' }}"
+  style="{{ computed.barStyle({ zIndex, statusBarHeight, safeAreaInsetTop }) }}; {{ customStyle }}">
   <view class="van-nav-bar__content">
     <view class="van-nav-bar__left" bind:tap="onClickLeft">
       <block wx:if="{{ leftArrow || leftText }}">
-        <van-icon
-          wx:if="{{ leftArrow }}"
-          size="16px"
-          name="arrow-left"
-          custom-class="van-nav-bar__arrow"
-        />
-        <view
-          wx:if="{{ leftText }}"
-          class="van-nav-bar__text"
-          hover-class="van-nav-bar__text--hover"
-          hover-stay-time="70"
-        >{{ leftText }}</view>
+        <van-icon wx:if="{{ leftArrow }}" size="16px" name="arrow-left" custom-class="van-nav-bar__arrow" />
+        <view wx:if="{{ leftText }}" class="van-nav-bar__text" hover-class="van-nav-bar__text--hover"
+          hover-stay-time="70">{{ leftText }}</view>
       </block>
       <slot wx:else name="left" />
     </view>
@@ -30,13 +19,9 @@
       <slot wx:else name="title" />
     </view>
     <view class="van-nav-bar__right" bind:tap="onClickRight">
-      <view
-        wx:if="{{ rightText }}"
-        class="van-nav-bar__text"
-        hover-class="van-nav-bar__text--hover"
-        hover-stay-time="70"
-      >{{ rightText }}</view>
+      <view wx:if="{{ rightText }}" class="van-nav-bar__text" hover-class="van-nav-bar__text--hover"
+        hover-stay-time="70">{{ rightText }}</view>
       <slot wx:else name="right" />
     </view>
   </view>
-</view>
+</view>

+ 5 - 1
app.json

@@ -21,7 +21,11 @@
         "constitutionDiagnosis/constitutionDiagnosis",
         "detectionResult/detectionResult",
         "helpList/helpList",
-        "helpDetails/helpDetails"
+        "helpDetails/helpDetails",
+        "evaluationIntroduction/evaluationIntroduction",
+        "textStep/textStep",
+        "testResultA/testResultA",
+        "testResultB/testResultB"
       ]
     }
   ],

+ 22 - 1
project.private.config.json

@@ -10,6 +10,27 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "subpages/evaluationIntroduction/evaluationIntroduction",
+          "pathName": "subpages/evaluationIntroduction/evaluationIntroduction",
+          "query": "type=physique",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "subpages/testResultA/testResultA",
+          "pathName": "subpages/testResultA/testResultA",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
+        {
+          "name": "subpages/testResultB/testResultB",
+          "pathName": "subpages/testResultB/testResultB",
+          "query": "",
+          "launchMode": "default",
+          "scene": null
+        },
         {
           "name": "subpages/helpList/helpList",
           "pathName": "subpages/helpList/helpList",
@@ -111,5 +132,5 @@
       ]
     }
   },
-  "libVersion": "3.6.4"
+  "libVersion": "3.6.6"
 }

+ 210 - 0
subpages/evaluationIntroduction/evaluationIntroduction.js

@@ -0,0 +1,210 @@
+// subpages/evaluationIntroduction/evaluationIntroduction.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    type: "physique",//报告类型
+    testSize: 9,
+    comScoreIndex:6,
+    testTitle: "睡眠质量指数评测",
+    testDesc: "本测评系统依据山东睡眠质量指数量表(SDPSQI)开发。\nSDPSO1由山东省中医药大学医学中心精神科睡眠和生物节律研究中心睡眠专家组编制,专门用于评定被试者近一个月的主观睡眠质量。SDPSQI作为一种科学、系统的睡眠质量评估工具为了解个体睡眠状况、诊断睡眠障碍以及制定相应的干预措施提供了重要的工具和平台。",
+    isHaveRes: false,//是否有测试过
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    console.log(options);
+
+    if (options.type) {
+      var type = options.type;
+      var testTitle = "";
+      var testDesc = "";
+      var testSize = 9;
+      if (type == "physique") {
+        // 体质
+        testSize = 9;
+        testTitle = "体质诊断检测";
+        testDesc = "本测试表由山东省中医药大学中医专家组(具有中医针灸师、中医芳香疗法指导师、医院临床检验科资质的主任医师们)提出。中医学依据气、血、水的平衡状态,将人分为六种体质。要改善身体的“不调”,最重要的就是先了解自己的体质。有人也可能是不同体质混合的“复合型”,而且人的体质日常是变化的,因此应根据每天变化的身体状态进行相应调理的养生疗法。我们根据人体部位分了八个方面,请从下面选项里选出和自己相符的项,提交后,系统会进行判断,并显示您的体质、分析和建议。";
+        this.checkPhysiqueData()
+      } else if (type == "sleep") {
+        // 睡眠质量
+        testSize = 25;
+        testTitle = "睡眠质量指数评测";
+        testDesc = "本测评系统依据山东睡眠质量指数量表(SDPSQI)开发。\nSDPSO1由山东省中医药大学医学中心精神科睡眠和生物节律研究中心睡眠专家组编制,专门用于评定被试者近一个月的主观睡眠质量。SDPSQI作为一种科学、系统的睡眠质量评估工具为了解个体睡眠状况、诊断睡眠障碍以及制定相应的干预措施提供了重要的工具和平台。";
+      }
+      this.setData({
+        testSize,
+        testTitle,
+        testDesc,
+        type
+      })
+    }
+
+  },
+
+  leftBack() {
+    wx.navigateBack()
+  },
+  toTest() {
+    // 去测试
+    wx.setStorageSync("testType", this.data.type);
+    wx.navigateTo({
+      url: '/subpages/textStep/textStep?type=' + this.data.type
+    })
+  },
+  toResult() {
+    // 结果页
+    if (this.data.type == "physique") {
+      // 体质
+      wx.navigateTo({
+        url: `/subpages/testResultB/testResultB?comScoreIndex=${this.data.comScoreIndex}`
+      })
+    } else if (this.data.type == "sleep") {
+      // 睡眠质量
+      wx.navigateTo({
+        url: '/subpages/testResultA/testResultA'
+      })
+    }
+  },
+ checkPhysiqueData() {
+    var that = this;
+    var userId = wx.getStorageSync("unionid");
+    wx.request({
+      url: `https://fare.somnisix.top/system/constitutionDiagnosis/user/${userId}`,
+      data: {
+        "token": "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijk5YzI3MjI2LTdkOWQtNDhiOC1hYjlhLWM4YjVjYWZiZGNkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.zITQOINFkHs19_1RAgHS4I9YMaVxVq0Dsn3t6r_K7rv3rXvJy0sMtodejIMi_PNa_m4uQYxnU-6k3wC2LZht_Q"
+      },
+      header: {
+        'Authorization': 'Bearer ' + "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijk5YzI3MjI2LTdkOWQtNDhiOC1hYjlhLWM4YjVjYWZiZGNkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.zITQOINFkHs19_1RAgHS4I9YMaVxVq0Dsn3t6r_K7rv3rXvJy0sMtodejIMi_PNa_m4uQYxnU-6k3wC2LZht_Q" // 在头部设置Bearer Token
+      },
+      method: 'GET',
+      success(res) {
+        try {
+          if (res && res.data && res.data.data) {
+            if (res.data.data.value2) {
+              var data = JSON.parse(res.data.data.value2);
+              var maxValueObj = that.findMaxValueKeyAndIndex(data);
+              that.setData({
+                comScoreIndex: maxValueObj.index,
+                isHaveRes: true
+              })
+
+            }
+          }
+
+        } catch (error) {
+          console.error(error);
+        }
+
+      },
+    })
+  },
+
+  // 体质的方法
+  // 取出最大值的obj
+  findMaxValueKeyAndIndex(obj) {
+    if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
+      throw new Error('Input must be a plain object');
+    }
+    let maxKey = null;
+    let maxValue = 0;
+    let maxIndex = 6;
+
+    const keys = Object.keys(obj);
+    keys.forEach((key, index) => {
+      const value = obj[key];
+      if (value > maxValue) {
+        maxValue = value;
+        maxKey = key;
+        maxIndex = index;
+      }
+    });
+
+    return {
+      key: maxKey,
+      value: maxValue,
+      index: maxIndex
+    };
+  },
+  /**
+   * A、B、C、D、E、F 最后积累的数量对比,按数量多少来判断,6个分别对应:气虚型、气滞型、血虚型、淤血型、水虚型、痰湿型
+ * 找出对象中值最大的键
+ * @param {Object} obj - 包含键值对的对象
+ * @returns {string|null} - 值最大的键,如果没有找到则返回null
+ */
+  findKeyWithMaxValue(obj) {
+    if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
+      throw new Error('Input must be a plain object');
+    }
+
+    let maxKey = null;
+    let maxValue = 0;
+
+    for (let key in obj) {
+      if (obj.hasOwnProperty(key)) {
+        if (obj[key] > maxValue) {
+          maxValue = obj[key];
+          maxKey = key;
+        }
+      }
+    }
+
+    return maxKey;
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    wx.removeStorageSync('testType');
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+    var that = this;
+    return {
+      title: that.data.testTitle,
+      path: '/subpages/evaluationIntroduction/evaluationIntroduction?type=' + that.data.type,
+    }
+  }
+})

+ 7 - 0
subpages/evaluationIntroduction/evaluationIntroduction.json

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "测评介绍",
+  "usingComponents": {
+    "authorized-login-dialog": "../../componets/authorized-login-dialog/authorizedLoginDialog"
+  },
+  "navigationStyle": "custom"
+}

+ 46 - 0
subpages/evaluationIntroduction/evaluationIntroduction.wxml

@@ -0,0 +1,46 @@
+<!--subpages/evaluationIntroduction/evaluationIntroduction.wxml-->
+<view>
+  <van-nav-bar title="" left-text="" leftArrow custom-class="nav-bar" bind:click-left="leftBack"></van-nav-bar>
+  <text class="page-title">{{testTitle}}</text>
+  <image class="page-icon" src="/subpages/images/testRes/ic_test_right.png"></image>
+  <view class="w-card">
+    <view class="test-info-view">
+      <view class="test-info-item flex-1">
+        <image src="/subpages/images/testRes/ic_test_time.png"></image>
+        <text class="test-info-item-title">3分钟</text>
+        <text class="test-info-item-desc">测评时间</text>
+      </view>
+      <view class="test-info-item">
+        <image src="/subpages/images/testRes/ic_test_size.png"></image>
+        <text class="test-info-item-title">{{testSize}}题</text>
+        <text class="test-info-item-desc">测评题数</text>
+      </view>
+      <view class="test-info-item flex-1">
+        <image src="/subpages/images/testRes/ic_test_member.png"></image>
+        <text class="test-info-item-title">12万</text>
+        <text class="test-info-item-desc">测评人数</text>
+      </view>
+    </view>
+    <view class="base-title-view">
+      <view class="base-title-line" />
+      <text class="base-title">测评介绍</text>
+      <view class="base-title-share-box">
+        <image src="/subpages/images/testRes/ic_test_share.png"></image>
+        <button open-type="share"></button>
+      </view>
+    </view>
+    <view class="test-desc-box">
+      <text class="test-desc">{{testDesc}}</text>
+      <image wx:if="{{type == 'sleep'}}" style="height: 480rpx;" src="/subpages/images/testRes/ic_test_desc_bg.png">
+      </image>
+      <image wx:else style="height: 636rpx;" src="/subpages/images/testRes/ic_test_desc_bg_tz.png"></image>
+    </view>
+  </view>
+  <view class="bottom-btn-view">
+    <text wx:if="{{!isHaveRes}}" class="start-test-btn" bindtap="toTest">立即测评</text>
+    <view wx:else class="res-test-btn-view">
+      <text class="view-res-btn" bindtap="toResult">查看结果</text>
+      <text class="restart-test-btn" bindtap="toTest">重新测评</text>
+    </view>
+  </view>
+</view>

+ 232 - 0
subpages/evaluationIntroduction/evaluationIntroduction.wxss

@@ -0,0 +1,232 @@
+/* subpages/evaluationIntroduction/evaluationIntroduction.wxss */
+page {
+  background: linear-gradient(180deg, #D6E8FE 0%, #FFFFFF 100%);
+}
+
+.nav-bar {
+  --nav-bar-icon-color: black !important;
+  width: 100vw;
+  background-color: transparent !important;
+  background: transparent !important;
+  position: sticky;
+  top: 0;
+  left: 0;
+}
+
+.page-title {
+  margin-left: 60rpx;
+  font-weight: 600;
+  font-size: 38rpx;
+  color: #222222;
+}
+
+.page-icon {
+  display: block;
+  width: 372rpx;
+  height: 372rpx;
+  position: fixed;
+  top: 36rpx;
+  right: 28rpx;
+  z-index: -1;
+}
+
+.w-card {
+  margin-top: 60rpx;
+  margin-left: auto;
+  margin-right: auto;
+  margin-bottom: 180rpx;
+  width: 710rpx;
+  box-shadow: 0rpx 8rpx 20rpx 0rpx #D3E0F4;
+  border-radius: 24rpx;
+  background: linear-gradient(90deg, #F8FBFF 4%, #FFFFFF 100%);
+}
+
+
+.bottom-btn-view {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+  height: 180rpx;
+  background: #FFFFFF;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: flex-start;
+}
+
+.start-test-btn {
+  margin-top: 16rpx;
+  width: 670rpx;
+  height: 84rpx;
+  background: linear-gradient(135deg, #53A9FF 0%, #1E8BFF 100%);
+  border-radius: 84rpx;
+  text-align: center;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #FFFFFF;
+  font-weight: bold;
+}
+
+.start-test-btn:active {
+  opacity: 0.7;
+}
+
+.res-test-btn-view {
+  margin-top: 16rpx;
+  width: 690rpx;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.restart-test-btn {
+  width: 336rpx;
+  height: 84rpx;
+  background: linear-gradient(135deg, #53A9FF 0%, #1E8BFF 100%);
+  border-radius: 84rpx;
+  text-align: center;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #FFFFFF;
+  font-weight: bold;
+}
+
+.restart-test-btn:active {
+  opacity: 0.7;
+}
+
+.view-res-btn {
+  width: 336rpx;
+  height: 84rpx;
+  background: #EFF7FF;
+  text-align: center;
+  border-radius: 84rpx;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #1E8BFF;
+  font-weight: bold;
+}
+
+.view-res-btn:active {
+  opacity: 0.7;
+}
+
+.test-info-view {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  border-bottom: 2rpx solid #DFECFE;
+}
+
+.test-info-item {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+.test-info-item image {
+  margin-top: 42rpx;
+  width: 52rpx;
+  display: block;
+  height: 52rpx;
+}
+
+.test-info-item-title {
+  margin-top: 12rpx;
+  font-weight: 500;
+  font-size: 32rpx;
+  color: #333333;
+}
+
+.test-info-item-desc {
+  margin-top: 6rpx;
+  margin-bottom: 40rpx;
+  font-weight: 400;
+  font-size: 24rpx;
+  color: #666666;
+}
+
+.flex-1 {
+  flex: 1;
+}
+
+.base-title-view {
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 10rpx;
+  width: calc(100% - 20rpx);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.base-title-line {
+  width: 6rpx;
+  margin-right: 16rpx;
+  margin-left: 20rpx;
+  height: 28rpx;
+  background: #1E8BFF;
+  border-radius: 4rpx;
+}
+
+.base-title {
+  flex: 1;
+  font-weight: 400;
+  font-size: 32rpx;
+  color: #333333;
+}
+
+.base-title-view image {
+  display: block;
+  padding: 20rpx;
+  width: 32rpx;
+  height: 32rpx;
+}
+
+.base-title-share-box {
+  position: relative;
+}
+
+.base-title-share-box button {
+  position: absolute;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  line-height: 76rpx;
+  width: 100%;
+  height: 100%;
+  padding: 0;
+  opacity: 0;
+  margin: 0;
+}
+
+.test-desc-box {
+  position: relative;
+  width: 100%;
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 10rpx;
+  display: flex;
+  flex-direction: column;
+}
+
+.test-desc-box image {
+  width: 100%;
+  margin-bottom: 30rpx;
+  display: block;
+}
+
+
+.test-desc {
+  position: absolute;
+  top: 100rpx;
+  left: 40rpx;
+  right: 40rpx;
+  font-weight: 400;
+  font-size: 28rpx;
+  color: #696F78;
+}

BIN
subpages/images/testRes/ic_test_desc_bg.png


BIN
subpages/images/testRes/ic_test_desc_bg_tz.png


BIN
subpages/images/testRes/ic_test_dot.png


BIN
subpages/images/testRes/ic_test_man.png


BIN
subpages/images/testRes/ic_test_man_check.png


BIN
subpages/images/testRes/ic_test_member.png


BIN
subpages/images/testRes/ic_test_right.png


BIN
subpages/images/testRes/ic_test_share.png


BIN
subpages/images/testRes/ic_test_share_ad.png


BIN
subpages/images/testRes/ic_test_size.png


BIN
subpages/images/testRes/ic_test_time.png


BIN
subpages/images/testRes/ic_test_women.png


BIN
subpages/images/testRes/ic_test_women_check.png


+ 0 - 15
subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment.js

@@ -288,21 +288,6 @@ Page({
 	},
 
 	answer2db: function () {
-		// db.collection('SAS').add({
-		//   data: {
-		//     answer: this.data.answer
-		//   },
-		//   success (res) {
-		//     console.log(res._id);
-		//   },
-		//   fail (res) {
-		//     wx.showToast({
-		//       icon: 'none',
-		//       title: '新增记录失败'
-		//     })
-		//     console.error('[数据库] [新增记录] 失败:', err)
-		//   }
-		// })
 		const answerJson = this.data.oldJsonList;
 		console.log('answerJson=' + JSON.stringify(answerJson))
 		let totalAllTemp = 0;

+ 154 - 0
subpages/testResultA/testResultA.js

@@ -0,0 +1,154 @@
+// subpages/textStep/textStep.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    comScoreIndex: 0,
+    comScore: 0,
+    comScoreDesc: "如果你在这一级别内,那么你的睡眠质量可就亮起红灯了。你必须警惕,因为你的睡眠质量确实比较糟糕,健康状况明显受损。饮食起居会受到一定影响,甚至部分工作你都开始感觉吃力。",
+    ratingResultsList: [{
+      title: "非常好",
+      icon: "/subpages/icons/ic_triangle_down_1.svg",
+      color: "#70B3FE"
+    }, {
+      title: "良好",
+      icon: "/subpages/icons/ic_triangle_down_2.svg",
+      color: "#68D89E"
+    }, {
+      title: "一般",
+      icon: "/subpages/icons/ic_triangle_down_3.svg",
+      color: "#FFA95A"
+    }, {
+      title: "差",
+      icon: "/subpages/icons/ic_triangle_down_4.svg",
+      color: "#FC726E"
+    }],
+  },
+
+  leftBack() {
+    wx.navigateBack()
+  },
+  toTest() {
+    // 去测试
+    wx.setStorageSync("testType", 'sleep');
+    wx.redirectTo({
+      url: '/subpages/textStep/textStep?type=sleep'
+    })
+  },
+  toHome() {
+    // 回家啦
+    wx.removeStorageSync('testType')
+    wx.reLaunch({
+      url: '/pages/index/index'
+    })
+  },
+  // 分数范围
+  judgmentScoreRange(scoreValue, startScore, endScore) {
+    return scoreValue >= startScore && scoreValue <= endScore;
+  },
+  // 描述判断
+  judgmentComScoreDesc() {
+    var _comScoreDesc = "";
+    if (this.judgmentScoreRange(this.data.comScore, 0, 5)) {
+      _comScoreDesc = "你目前的睡眠质量非常高,而且健康状况良好,这一切应该继续保持下去。"
+    } else if (this.judgmentScoreRange(this.data.comScore, 6, 10)) {
+      _comScoreDesc = "你的睡眠质量平平,健康状况也受到影响, 如果再不引起你对睡眠质量的足够重视, 那么你的睡眠质量很可能会迅速下降,向下一级别发展。"
+    } else if (this.judgmentScoreRange(this.data.comScore, 11, 15)) {
+      _comScoreDesc = "如果你在这一级别内,那么你的睡眠质量可 就亮起红灯了。你必须警惕,因为你的睡眠质量确实比较糟糕,健康状况明显受损。饮食起居会受到一定影响,甚至部分工作你都开始感觉吃力。"
+    } else {
+      _comScoreDesc = "天啊!你的睡眠质量已经到了令人发指的地 步—长期睡眠不足导致了你的健康状况严重恶化,这就是你工作力不从心,情绪起伏不定的原因。"
+    }
+    this.setData({
+      comScoreDesc: _comScoreDesc
+    })
+  },
+  // 评分判断
+  judgmentComScoreIndex() {
+    let comScoreIndex = 0;
+    let _comScoreStatus = "";
+    if (this.data.comScore >= 0 && this.data.comScore <= 5) {
+      _comScoreStatus = "非常好";
+    } else if (this.data.comScore >= 6 && this.data.comScore <= 10) {
+      _comScoreStatus = "良好";
+      comScoreIndex = 1;
+    } else if (this.data.comScore >= 11 && this.data.comScore <= 15) {
+      _comScoreStatus = "一般";
+      comScoreIndex = 2;
+    } else {
+      _comScoreStatus = "差";
+      comScoreIndex = 3;
+    }
+    this.setData({
+      comScoreIndex: comScoreIndex
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    // 接收一个分数
+    if (options.comScore) {
+      this.setData({
+        comScore: options.comScore
+      })
+    }
+
+    this.judgmentComScoreIndex();
+    this.judgmentComScoreDesc();
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+    var that = this;
+    return {
+      title: '体质诊断检测',
+      path: '/subpages/evaluationIntroduction/evaluationIntroduction?type=sleep',
+    }
+  }
+})

+ 4 - 0
subpages/testResultA/testResultA.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "睡眠质量测评结果",
+  "navigationStyle": "custom"
+}

+ 52 - 0
subpages/testResultA/testResultA.wxml

@@ -0,0 +1,52 @@
+<!--subpages/textStep/textStep.wxml-->
+<view>
+  <van-nav-bar title="" left-text="" leftArrow custom-class="nav-bar" bind:click-left="leftBack"></van-nav-bar>
+  <text class="page-title">睡眠质量指数分析</text>
+  <view class="w-card">
+    <view class="resultsAreShown-content-h">
+      <text class="resultsAreShown-content-desc">睡眠得分:</text>
+      <text class="resultsAreShown-content-score">{{comScore}}</text>
+      <text class="resultsAreShown-content-units">分</text>
+    </view>
+
+    <view class="resultsAreShown-content-score-view">
+      <view wx:for="{{ratingResultsList}}" wx:for-item="item" wx:for-index="index" wx:key="{{index}}"
+        class="resultsAreShown-content-score-item">
+        <image class="resultsAreShown-content-score-icon" src="{{item.icon}}"
+          style="{{'opacity: '+(comScoreIndex == index ? '1' : '0')}}">
+        </image>
+        <view class="resultsAreShown-content-score-line" style="{{'background-color:'+item.color}}">
+        </view>
+        <text class="resultsAreShown-content-score-desc"
+          style="{{comScoreIndex == index ? 'color:'+item.color : ''}}">{{item.title}}</text>
+
+      </view>
+    </view>
+
+  </view>
+  <view class="w-card">
+    <view class="base-title-view">
+      <view class="base-title-line" />
+      <text class="base-title">结果分析</text>
+    </view>
+    <text class="resultAnalysis">{{comScoreDesc}}</text>
+  </view>
+  <view class="w-card">
+    <view class="base-title-view">
+      <view class="base-title-line" />
+      <text class="base-title">睡眠建议</text>
+    </view>
+    <text class="resultAnalysis">{{comScoreDesc}}</text>
+  </view>
+  <view class="ad-box">
+    <image src="/subpages/images/testRes/ic_test_share_ad.png" mode="widthFix"></image>
+    <button open-type="share"></button>
+  </view>
+  <view style="height: 200rpx;" />
+  <view class="bottom-btn-view">
+    <view class="res-test-btn-view">
+      <text class="view-res-btn" bindtap="toTest">重新评测</text>
+      <text class="restart-test-btn" bindtap="toHome">返回首页</text>
+    </view>
+  </view>
+</view>

+ 214 - 0
subpages/testResultA/testResultA.wxss

@@ -0,0 +1,214 @@
+/* subpages/textStep/textStep.wxss */
+page {
+  background: linear-gradient(180deg, #D6E8FE 0%, #FFFFFF 100%);
+}
+
+.nav-bar {
+  --nav-bar-icon-color: black !important;
+  width: 100vw;
+  background-color: transparent !important;
+  background: transparent !important;
+  position: sticky;
+  top: 0;
+  left: 0;
+}
+
+.page-title {
+  margin-left: 40rpx;
+  font-weight: 600;
+  font-size: 38rpx;
+  color: #222222;
+}
+
+.w-card {
+  display: flex;
+  flex-direction: column;
+  margin-top: 20rpx;
+  margin-left: auto;
+  padding-bottom: 30rpx;
+  margin-right: auto;
+  width: 710rpx;
+  box-shadow: 0rpx 8rpx 20rpx 0rpx #D3E0F4;
+  border-radius: 24rpx;
+  background: linear-gradient(90deg, #F8FBFF 4%, #FFFFFF 100%);
+}
+
+.base-title-view {
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 30rpx;
+  width: calc(100% - 20rpx);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.base-title-line {
+  width: 6rpx;
+  margin-right: 16rpx;
+  margin-left: 20rpx;
+  height: 28rpx;
+  background: #1E8BFF;
+  border-radius: 4rpx;
+}
+
+.base-title {
+  flex: 1;
+  font-weight: 400;
+  font-size: 32rpx;
+  color: #333333;
+  font-weight: 600;
+}
+
+.resultAnalysis {
+  font-size: 28rpx;
+  color: #666666;
+  margin: 30rpx 30rpx 30rpx;
+}
+
+.ad-box {
+  margin: 20rpx auto;
+  width: 710rpx;
+  height: 104rpx;
+  position: relative;
+}
+
+.ad-box image {
+  display: block;
+  width: 710rpx;
+  height: 108rpx;
+  border-radius: 24rpx 24rpx 24rpx 24rpx;
+  box-shadow: 0rpx 8rpx 20rpx 0rpx #E2ECFA;
+}
+
+.ad-box button {
+  position: absolute;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  width: 100%;
+  height: 100%;
+  padding: 0;
+  opacity: 0;
+  margin: 0;
+}
+
+.bottom-btn-view {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+  height: 180rpx;
+  background: #FFFFFF;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: flex-start;
+}
+
+
+.res-test-btn-view {
+  margin-top: 16rpx;
+  width: 690rpx;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.restart-test-btn {
+  width: 336rpx;
+  height: 84rpx;
+  background: linear-gradient(135deg, #53A9FF 0%, #1E8BFF 100%);
+  border-radius: 84rpx;
+  text-align: center;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #FFFFFF;
+  font-weight: bold;
+}
+
+.restart-test-btn:active {
+  opacity: 0.7;
+}
+
+.view-res-btn {
+  width: 336rpx;
+  height: 84rpx;
+  background: #EFF7FF;
+  text-align: center;
+  border-radius: 84rpx;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #1E8BFF;
+  font-weight: bold;
+}
+
+.view-res-btn:active {
+  opacity: 0.7;
+}
+
+.resultsAreShown-content-h {
+  display: flex;
+  flex-direction: row;
+  align-items: baseline;
+  width: 100%;
+}
+
+.resultsAreShown-content-desc {
+  font-size: 28rpx;
+  margin-left: 40rpx;
+  margin-top: 50rpx;
+  color: #333333;
+}
+
+.resultsAreShown-content-score {
+  font-weight: 500;
+  color: #333333;
+  font-size: 48rpx;
+}
+
+.resultsAreShown-content-units {
+  font-weight: 400;
+  font-size: 24rpx;
+  color: #333333;
+}
+
+.resultsAreShown-content-score-view {
+  display: flex;
+  flex-direction: row;
+  margin-top: 22rpx;
+  margin-bottom: 20rpx;
+  margin-left: 24rpx;
+  align-items: center;
+  width: calc(100% - 48rpx);
+}
+
+.resultsAreShown-content-score-item {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+.resultsAreShown-content-score-icon {
+  width: 24rpx;
+  opacity: 0;
+  height: 16rpx;
+}
+
+.resultsAreShown-content-score-line {
+  width: calc(100% - 32rpx);
+  height: 12rpx;
+  margin-top: 20rpx;
+  border-radius: 12rpx;
+}
+
+.resultsAreShown-content-score-desc {
+  font-size: 24rpx;
+  margin-top: 16rpx;
+  line-height: 32rpx;
+  color: #666666;
+}

+ 134 - 0
subpages/testResultB/testResultB.js

@@ -0,0 +1,134 @@
+// subpages/textStep/textStep.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    comScoreIndex: 6,
+    ratingResultsList: [{
+      index: 0,
+      title: "气虚型",
+      tips: "体力和气力都低下,需要规律性的生活方式",
+      subTitle: "累啊』『真倒霉』成了口头语",
+      desc: "一般来说气虚型的人,就是被称作生命力的“气”整体不足。因为体力和气力的整体下降,无论做什么都会感到“真倒霉”“真麻烦”,饮食和运动也是马马虎虎地应付。结果,陷入生活越不规律,“气”就越衰弱的恶性循环。特点就是免疫力降低,易患感冒,而且很难一次性治愈。\n\n为了改善气虚,最重要的就是要有规律性的生活方式。晚上早睡,早上早起。日常食物也要以应季的食材为主,促进胃肠的蠕动,尽量多食用可以提升体温的豆类、薯类等食材。\n\n适度的运动是必要的,但因体力下降,所以万不可强求大的运动量,可以从散步呀、瑜伽呀等轻负荷的运动练起。\n\n特征:驼背。显老像;稍一运动就出汗;手脚发冷;易疲劳,总有困意与疲倦感;下半身易发胖。"
+    }, {
+      index: 1,
+      title: "气滞型",
+      tips: "常常紧张、焦虑~要有意识地放松自己",
+      subTitle: "感情起伏剧烈",
+      desc: "“气”本来是在体内正常循环的,但是因紧张和压力等使气滞留,就造成了气滞型。“气’一旦滞留,就表现为腹胀、肿胀、疼痛等症状。而且,感情起伏剧烈也是其特征。一旦情绪低落,很快就会焦虑起来,给人以“易发怒”歇斯底里”的感觉。更年期出现气滞的人也不在少数。\n\n养生法无疑是减轻压力的最好办法,但暴饮暴食则会适得其反。值得注意的是体重的增加会影响气的循环。香草和香味蔬菜有促进气循环和防止暴饮暴食的作用。除此之外,每天的日常安排中应留出自我放松的时间,也可以进行深呼吸,这些都有助于改善气滞。\n\n气滞型:入睡困难;眼睛充血;肚子容易生赘肉;焦虑,易怒,皮肤油腻,发红;易打嗝,矢气。"
+    }, {
+      index: 2,
+      title: "血虚型",
+      tips: "饮食生活无规律~可能也有气虚或气滞的原因",
+      subTitle: "头发散乱,皮肤无光泽",
+      desc: "你是否为了减肥极端地限制饮食,或者光在外边吃快餐?如果一直这样,就会使营养失去平衡,引起“血”的不足,陷入血虚状态。\n\n为此,日常饮食重要的是要注意营养的平衡,特别要多食用有造血作用的羊栖菜、动物肝脏、梅干等。“血”增加了,头发散乱、皮肤无光泽这些血虚型的症状自然就消失了。夜间是人体的造血时间,因此不要熬夜。还要控制电脑和手机的使用,也要控制看电视的时间。中医学以为用眼是消耗“血”的。\n\n特征:头发脆弱,脱发;常常眩晕,站起时头晕;脸色不好,皮肤干燥;指甲偏薄,易裂;耳鸣;冷静,认真型。"
+    }, {
+      index: 3,
+      title: "淤血型",
+      tips: "血流不畅~更要注意减压,慎食生冷食品",
+      subTitle: "常常感到肩凝、头痛",
+      desc: "血流不顺畅,易在体内形成血块(瘀血)。其原因有喜食生冷食品、压力大、过劳、睡眠不足等等。也有因气虚和血虚造成的瘀血。\n\n对这个型的人,首先是必须使其血行畅通,提高代谢。要多食用牛蒡、蒟蒻(魔芋)、黑醋等有化解瘀血作用的食品,也要多食用生姜和韭菜、葱等有香味的蔬菜。饮料也要尽量选择热你,偏冷会影响血循环。\n\n要养成运动的习惯。运动可以促进血行,缓解瘀血引起的肩凝和腰痛。当然,按摩下半身也可以有效地改善脸部的气色。\n\n特征:容易被晒伤;容易长色斑,雀斑;容易出现黑眼圈;常常为肩凝和腰痛烦恼;经血中有动物肝脏样血块;基本上自制力较强,但偶尔也会感情爆发。"
+    }, {
+      index: 4,
+      title: "水虚型",
+      tips: "身体如同干枯一般~避免食用香辛食物和剧烈运动",
+      subTitle: "常为头晕眼花、身体发热而烦恼",
+      desc: "体内水分不足称为水虚。皮肤、毛发、大便干燥的入水虚的可能性较大。而且,这类人因为给身体起到降温作用的水分不足,所以,常常感到头晕眼花或者身体发热。\n\n作为养生法,就是要通过食物的摄取,有效地补充水分。其中,苹果和香蕉、白菜可以有效地滋润身体,要有意识地多多食用。而且,因为睡眠中容易出汗,水分会在不知不觉中流失,因此,要在枕边预备下温开水,醒来后先饮水。\n\n另一方面,要尽量避免食用香辛食材。因为香辛料有温暖身体的作用,可能会加重头晕眼花和身体发热的症状。水虚的人还要避免剧烈的运动。因为他们的关节水分不足,剧烈运动会引发疼痛。\n\n特征:睡眠浅,盗汗;关节运动不灵活;不明原因的消沉,情绪低落;毛发和皮肤脆弱,口腔和咽喉干燥;便秘,尿量少。"
+    }, {
+      index: 5,
+      title: "痰湿型",
+      tips: "体内多余的水分~常常引发各种“不调”,要慎食味重食品",
+      subTitle: "体型胖墩墩的",
+      desc: "现代职场女性多为痰湿型。所谓痰湿就是生活不规律、压力大等原因造成身体内形成多余的水分块(痰湿)的状态。因为我们的身体70%是由水构成的,所以痰湿的影响不容忽视,会造成我们的身心状态出现各种各样的“不调”。\n\n首先,有氧运动能够增加肌肉的弹力,促进血行和代谢。肌肉弹力的提高、血行和代谢的改善,就可以通过汗和取把多余的水分排出体外。\n\n第二要注意减少冷饮和味重食品的摄入量,因为它们会造成水分的滞留。\n\n第三要多食用黄瓜和西瓜、梨等有较好利尿作用的食物。也要多食红豆、薏米。\n\n特征:整个身体容易浮肿;容易发胖;早晨起床后脸上有枕头的痕迹;皮肤发白。胖墩墩的;爱生湿乎乎的疙瘩;性格自我,爱慕虚荣。"
+    }, {
+      index: 6,
+      title: "健康型",
+      tips: "",
+      subTitle: "身体非常棒",
+      desc: "太棒了,您的身体非常健康,请继续保持!"
+    },]
+  },
+
+  leftBack() {
+    wx.navigateBack()
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    if (options.comScoreIndex) {
+      this.setData({
+        comScoreIndex: options.comScoreIndex
+      })
+    }
+  },
+
+  toTest() {
+    // 去测试
+    wx.setStorageSync("testType", 'physique');
+    wx.redirectTo({
+      url: '/subpages/textStep/textStep?type=physique'
+    })
+  },
+  toHome() {
+    // 回家啦
+    wx.removeStorageSync('testType')
+    wx.reLaunch({
+      url: '/pages/index/index'
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+    var that = this;
+    return {
+      title: '体质诊断检测',
+      path: '/subpages/evaluationIntroduction/evaluationIntroduction?type=physique',
+    }
+  }
+})

+ 4 - 0
subpages/testResultB/testResultB.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "体质测评结果",
+  "navigationStyle": "custom"
+}

+ 39 - 0
subpages/testResultB/testResultB.wxml

@@ -0,0 +1,39 @@
+<!--subpages/textStep/textStep.wxml-->
+<view>
+  <van-nav-bar title="" left-text="" leftArrow custom-class="nav-bar" bind:click-left="leftBack"></van-nav-bar>
+  <view class="w-card">
+    <text class="card-tag">您的体质是</text>
+    <view class="title-view">
+      <image src="/subpages/images/testRes/ic_test_dot.png" />
+      <text>{{ratingResultsList[comScoreIndex].title}}</text>
+      <image src="/subpages/images/testRes/ic_test_dot.png" />
+    </view>
+    <text wx:if="{{ratingResultsList[comScoreIndex].tips.length > 0}}"
+      class="desc">{{ratingResultsList[comScoreIndex].tips}}</text>
+  </view>
+  <view class="w-card">
+    <view class="base-title-view">
+      <view class="base-title-line" />
+      <text class="base-title">结果分析</text>
+    </view>
+    <text class="resultAnalysis">{{ratingResultsList[comScoreIndex].desc}}</text>
+  </view>
+  <view class="w-card">
+    <view class="base-title-view">
+      <view class="base-title-line" />
+      <text class="base-title">体质提升建议</text>
+    </view>
+    <text class="resultAnalysis">{{ratingResultsList[comScoreIndex].desc}}</text>
+  </view>
+  <view class="ad-box">
+    <image src="/subpages/images/testRes/ic_test_share_ad.png" mode="widthFix"></image>
+    <button open-type="share"></button>
+  </view>
+  <view style="height: 200rpx;" />
+  <view class="bottom-btn-view">
+    <view class="res-test-btn-view">
+      <text class="view-res-btn" bindtap="toTest">重新评测</text>
+      <text class="restart-test-btn" bindtap="toHome">返回首页</text>
+    </view>
+  </view>
+</view>

+ 188 - 0
subpages/testResultB/testResultB.wxss

@@ -0,0 +1,188 @@
+/* subpages/textStep/textStep.wxss */
+page {
+  background: linear-gradient(180deg, #D6E8FE 0%, #FFFFFF 100%);
+}
+
+.nav-bar {
+  --nav-bar-icon-color: black !important;
+  width: 100vw;
+  background-color: transparent !important;
+  background: transparent !important;
+  position: sticky;
+  top: 0;
+  left: 0;
+}
+
+.w-card {
+  display: flex;
+  flex-direction: column;
+  margin-top: 20rpx;
+  margin-left: auto;
+  margin-right: auto;
+  width: 710rpx;
+  padding-bottom: 30rpx;
+  box-shadow: 0rpx 8rpx 20rpx 0rpx #D3E0F4;
+  border-radius: 24rpx;
+  background: linear-gradient(90deg, #F8FBFF 4%, #FFFFFF 100%);
+}
+
+.card-tag {
+  width: fit-content;
+  padding: 12rpx 26rpx;
+  background: linear-gradient(90deg, #1E8BFF 80%, #53A9FF 100%);
+  font-weight: 400;
+  font-size: 28rpx;
+  color: #FFFFFF;
+  border-radius: 24rpx 0rpx 24rpx 0rpx;
+}
+
+.title-view {
+  margin: 20rpx auto;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: center;
+
+}
+
+.title-view image {
+  display: block;
+  width: 38rpx;
+  height: 22rpx;
+}
+
+.title-view text {
+  margin: 0 20rpx;
+  font-size: 48rpx;
+  color: #1E8BFF;
+  font-weight: 600;
+}
+
+.desc {
+  padding: 16rpx 32rpx;
+  width: fit-content;
+  display: block;
+  margin: 0 auto;
+  background: #F7F8FD;
+  border-radius: 12rpx;
+  font-weight: 400;
+  font-size: 24rpx;
+  color: #5C748D;
+}
+
+.base-title-view {
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 30rpx;
+  width: calc(100% - 20rpx);
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.base-title-line {
+  width: 6rpx;
+  margin-right: 16rpx;
+  margin-left: 20rpx;
+  height: 28rpx;
+  background: #1E8BFF;
+  border-radius: 4rpx;
+}
+
+.base-title {
+  flex: 1;
+  font-weight: 400;
+  font-size: 32rpx;
+  color: #333333;
+  font-weight: 600;
+}
+
+.resultAnalysis {
+  font-size: 28rpx;
+  color: #666666;
+  margin: 30rpx 30rpx 30rpx;
+}
+
+.ad-box {
+  margin: 20rpx auto;
+  width: 710rpx;
+  height: 104rpx;
+  position: relative;
+}
+
+.ad-box image {
+  display: block;
+  width: 710rpx;
+  height: 108rpx;
+  border-radius: 24rpx 24rpx 24rpx 24rpx;
+  box-shadow: 0rpx 8rpx 20rpx 0rpx #E2ECFA;
+}
+
+.ad-box button {
+  position: absolute;
+  top: 0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  width: 100%;
+  height: 100%;
+  padding: 0;
+  opacity: 0;
+  margin: 0;
+}
+
+.bottom-btn-view {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+  height: 180rpx;
+  background: #FFFFFF;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: flex-start;
+}
+
+
+.res-test-btn-view {
+  margin-top: 16rpx;
+  width: 690rpx;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.restart-test-btn {
+  width: 336rpx;
+  height: 84rpx;
+  background: linear-gradient(135deg, #53A9FF 0%, #1E8BFF 100%);
+  border-radius: 84rpx;
+  text-align: center;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #FFFFFF;
+  font-weight: bold;
+}
+
+.restart-test-btn:active {
+  opacity: 0.7;
+}
+
+.view-res-btn {
+  width: 336rpx;
+  height: 84rpx;
+  background: #EFF7FF;
+  text-align: center;
+  border-radius: 84rpx;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #1E8BFF;
+  font-weight: bold;
+}
+
+.view-res-btn:active {
+  opacity: 0.7;
+}

+ 4 - 2
subpages/testSAS/testSAS.js

@@ -15,7 +15,8 @@ Page({
       descColor: "#4160AD",
       border: "1rpx solid #c8d7ff",
       btnBg: "linear-gradient(135deg, #2957CB 0%, #649DFA 100%)",
-      url: "/subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment"
+      // url: "/subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment",
+      url: "/subpages/evaluationIntroduction/evaluationIntroduction?type=sleep"
     }, {
       icon: "/subpages/images/ic_test_b.png",
       title: "体质诊断检测",
@@ -25,7 +26,8 @@ Page({
       descColor: "#4E1915",
       border: "1rpx solid #ffd3d3",
       btnBg: "linear-gradient(135deg, #F34556 0%, #FC8893 100%)",
-      url: "/subpages/constitutionDiagnosis/constitutionDiagnosis"
+      // url: "/subpages/constitutionDiagnosis/constitutionDiagnosis",
+      url: "/subpages/evaluationIntroduction/evaluationIntroduction?type=physique"
     }]
   },
   toSleepEvaluation() {

+ 1305 - 0
subpages/textStep/textStep.js

@@ -0,0 +1,1305 @@
+// subpages/textStep/textStep.js
+const baseUrl = "https://fare.somnisix.top/";
+const authorization = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijk5YzI3MjI2LTdkOWQtNDhiOC1hYjlhLWM4YjVjYWZiZGNkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.zITQOINFkHs19_1RAgHS4I9YMaVxVq0Dsn3t6r_K7rv3rXvJy0sMtodejIMi_PNa_m4uQYxnU-6k3wC2LZht_Q";
+const api = "system/sleepEvaluation";
+
+const homeApi = "https://fare.somnisix.top";
+const homeApiTest = "http://localhost:8080";
+const token = "eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6Ijk5YzI3MjI2LTdkOWQtNDhiOC1hYjlhLWM4YjVjYWZiZGNkNyIsInVzZXJuYW1lIjoiYWRtaW4ifQ.zITQOINFkHs19_1RAgHS4I9YMaVxVq0Dsn3t6r_K7rv3rXvJy0sMtodejIMi_PNa_m4uQYxnU-6k3wC2LZht_Q";
+
+let countABCDEF;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    type: "sleep",//报告类型
+    testTitle: "睡眠质量指数评测",
+    step: 1,
+    stepTotal: 9,
+    gender: 1,//1 男 2 女
+    age: '',//年龄
+    height: '',//身高
+    weight: '',//体重
+    currentDate: "",
+    currentDateItem: null,
+    showDateDialog: false,
+    formatter(type, value) {
+      if (type === 'hour') {
+        return `${value}时`;
+      }
+      if (type === 'minute') {
+        return `${value}分`;
+      }
+      return value;
+    },
+    hotel: '',//酒店
+    room: '',//房间
+    physiqueData: [
+      {
+        id: 1,
+        title: '身体综合(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'A', label: '易疲劳,总感到疲倦' },
+          { value: '1', remark: 'A', label: '好出汗,一活动就冒汗' },
+          { value: '2', remark: 'A', label: '易感冒,恢复慢' },
+          { value: '3', remark: 'A', label: '稍一活动就气喘' },
+          { value: '4', remark: 'A', label: '疲劳后身体就不舒服' },
+          { value: '5', remark: 'A', label: '无食欲' },
+          { value: '6', remark: 'A', label: '手脚发凉' },
+          { value: '7', remark: 'A', label: '肌肉无力' },
+          { value: '8', remark: 'B', label: '腹部易滞气' },
+          { value: '9', remark: 'B', label: '头痛、肩凝、关节痛、胃疼、手脚麻痹' },
+          { value: '10', remark: 'B', label: '紧张、发怒后身体不舒服' },
+          { value: '11', remark: 'B', label: '身体有痛感后,疼痛部位游走不定' },
+          { value: '12', remark: 'C', label: '易眩晕和站起时头晕' },
+          { value: '13', remark: 'C', label: '常感到心慌' },
+          { value: '14', remark: 'C', label: '易头晕眼花' },
+          { value: '15', remark: 'D', label: '有受伤和手术后的旧伤痛' },
+          { value: '16', remark: 'D', label: '感到肩和腰、头有针扎样痛' },
+          { value: '17', remark: 'D', label: '入夜后容易出现肩、腰、头疼痛' },
+          { value: '18', remark: 'E', label: '喉咙易渴,常想喝水' },
+          { value: '19', remark: 'E', label: '感冒愈后常干咳' },
+          { value: '20', remark: 'E', label: '易便秘,大便呈球状' },
+          { value: '21', remark: 'E', label: '尿量少、色浓' },
+          { value: '22', remark: 'E', label: '身体总是发热' },
+          { value: '23', remark: 'E', label: '持续低烧' },
+          { value: '24', remark: 'F', label: '常感到身体和手脚沉重,易浮肿' },
+          { value: '25', remark: 'F', label: '胃部不适、恶心' },
+          { value: '26', remark: 'F', label: '雨天和湿度高时身体状况就很糟糕' },
+          { value: '27', remark: 'F', label: '有时眩晕' },
+          { value: '28', remark: 'F', label: '大便偏软' },
+          { value: '29', remark: 'F', label: '易恶心、呕吐、晕车' },
+          { value: '30', remark: '', label: '以上都没有' },
+        ]
+      },
+      {
+        id: 2,
+        title: '面部五官(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'B', label: '喉头部有异物感' },
+          { value: '1', remark: 'C', label: '脸色不好' },
+          { value: '2', remark: 'D', label: '眼圈发黑' },
+          { value: '3', remark: 'E', label: '眼睛经常模糊不清' },
+          { value: '4', remark: 'E', label: '多呈现消极、羸弱的面孔' },
+          { value: '5', remark: 'F', label: '唾液和痰较多,中发黏' },
+          { value: '6', remark: 'F', label: '易犯花粉症和鼻炎,容易淌鼻涕' },
+          { value: '7', remark: '', label: '以上都没有' },
+        ]
+      },
+      {
+        id: 3,
+        title: '皮肤毛发(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'C', label: '头发脆弱,脱发' },
+          { value: '1', remark: 'C', label: '皮肤和指甲无光泽' },
+          { value: '2', remark: 'D', label: '皮肤干燥易皲裂,色斑、雀斑多' },
+          { value: '3', remark: 'D', label: '皮肤呈青紫色或黑紫色,不光滑' },
+          { value: '4', remark: 'D', label: '肤色暗淡' },
+          { value: '5', remark: 'E', label: '洗浴后皮肤很快干燥,易发痒' },
+          { value: '6', remark: 'E', label: '皮肤纹理粗糙、毛孔张开' },
+          { value: '7', remark: '', label: '以上都没有' },
+        ]
+      },
+      {
+        id: 4,
+        title: '情绪方面(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'A', label: '经常情绪低落,容易受伤害' },
+          { value: '1', remark: 'B', label: '焦虑、易怒' },
+          { value: '2', remark: 'B', label: '常长吁短叹、嗳气' },
+          { value: '3', remark: '', label: '以上都没有' },
+        ]
+      },
+      {
+        id: 5,
+        title: '月经方面(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'B', label: '月经前身体不适' },
+          { value: '1', remark: 'C', label: '经血量少或月经周期过长' },
+          { value: '2', remark: 'D', label: '月经痛加重、经血中有动物肝脏血块' },
+          { value: '3', remark: '', label: '以上都没有' },
+        ]
+      },
+      {
+        id: 6,
+        title: '性格方面(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'A', label: '过度依赖人际关系' },
+          { value: '1', remark: 'B', label: '具有攻击性,不善于体谅别人' },
+          { value: '2', remark: 'C', label: '属冷静、认真型' },
+          { value: '3', remark: 'C', label: '善于制造一个自我世界并沉溺其中' },
+          { value: '4', remark: 'D', label: '忍耐性较强的性格,容易积聚压力' },
+          { value: '5', remark: 'D', label: '接人待物中规中矩,严守礼节' },
+          { value: '6', remark: 'F', label: '以自我为中心,争强好胜,嫉妒心强,爱慕虚荣' },
+          { value: '7', remark: 'F', label: '喜欢奢华、热闹的氛围' },
+          { value: '8', remark: '', label: '以上都没有' },
+        ]
+      },
+      {
+        id: 7,
+        title: '睡眠(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'B', label: '入睡困难' },
+          { value: '1', remark: 'C', label: '睡眠浅,易做梦' },
+          { value: '2', remark: '', label: '以上都没有' },
+        ]
+      },
+      {
+        id: 8,
+        title: '舌头状态(多选)',
+        type: 'checkbox',
+        value: [],//选出来的values
+        options: [
+          { value: '0', remark: 'A', label: '整体色淡;厚、肿大;边缘呈齿状' },
+          { value: '1', remark: 'B', label: '两侧赤红;中间色淡或偏白;薄薄的黄色舌苔' },
+          { value: '2', remark: 'C', label: '舌体偏小;色淡、偏白,舌苔整体偏薄' },
+          { value: '3', remark: 'D', label: '舌色暗、偏紫色;有黑色斑点;舌下两根静脉粗粗地浮现出来' },
+          { value: '4', remark: 'E', label: '舌色整体发红;舌苔少、甚至没有;舌面有齿痕' },
+          { value: '5', remark: 'F', label: '舌苔厚、黏黏糊糊;舌苔色黄或白;舌体肿胀' },
+          { value: '6', remark: '', label: '以上都没有' },
+        ]
+      }
+    ],
+    sleepData: [
+      {
+        id: 1,
+        title: '过去1个月通常上床睡觉的时间是?',
+        type: 'date',
+        value: '',//选出来的value
+        options: [
+          { value: '', label: '上床睡觉的时间' },
+        ]
+      }, {
+        id: 2,
+        title: '过去1个月你每晚通常要多长时间(分钟)才能入睡?',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '<15分钟' },
+          { value: 'b', label: '16-30分钟' },
+          { value: 'c', label: '31-60分钟' },
+          { value: 'd', label: '>60分钟' },
+        ]
+      }, {
+        id: 3,
+        title: '过去1个月每天早上通常什么时候起床?',
+        type: 'date',
+        value: '',//选出来的value
+        options: [
+          { value: '', label: '起床时间' },
+        ]
+      }, {
+        id: 4,
+        title: '过去1个月你每天实际睡眠的时间有多少?',
+        type: 'date',
+        value: '',//选出来的value
+        options: [
+          { value: '', label: '每晚实际睡眠时间' },
+        ]
+      }, {
+        id: 5,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'A.不能在30分钟内入睡',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 6,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'B.在晚上睡眠中醒来或早醒',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 7,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'C.晚上有无起床上洗手间',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 8,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'D.不舒服的呼吸',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 9,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'E.大声咳嗽或打鼾',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 10,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'F.感到寒冷',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 11,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'G.感到太热',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 12,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'H.做噩梦',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 13,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'H.出现疼痛',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 14,
+        title: '过去1个月你是否因为以下问题而经常睡眠不好?',
+        subTitle: 'J.其他影响睡眠的事情',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 15,
+        title: '你对过去1个月睡眠质量评分',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '非常好' },
+          { value: 'b', label: '尚好' },
+          { value: 'c', label: '不好' },
+          { value: 'd', label: '非常差' },
+        ]
+      }, {
+        id: 16,
+        title: '近1个月你用催眠药物的情况',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 17,
+        title: '过去1个月你在开车、吃饭或参加社会活动时难以保持清醒状态?',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 18,
+        title: '过去1个月你在积极完成事情上有无困难?',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '没有困难' },
+          { value: 'b', label: '有一点困难' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 19,
+        title: '你是与人同睡一床(睡觉同伴,包括配偶等)或有室友?',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '没有与人同睡一床或有室友' },
+          { value: 'b', label: '同伴或室友在另外房间' },
+          { value: 'c', label: '同伴在同一房间但不睡同床' },
+          { value: 'd', label: '同伴在同一床上' },
+        ]
+      }, {
+        id: 20,
+        title: '在你睡觉时,有无打鼾声',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 21,
+        title: '在你睡觉时,呼吸之间有没有长时间停顿',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 22,
+        title: '在你睡觉时,你的腿有无抽动或者有痉挛',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }, {
+        id: 23,
+        title: '在你睡觉时是否出现不能辨认方向或混乱状态',
+        type: 'radio',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      },
+      {
+        id: 24,
+        title: '在你睡觉时你有无其他睡不安宁的情况',
+        type: 'radio&input',
+        subTitle: '若有,请描述',
+        value: '',//选出来的value
+        options: [
+          { value: 'a', label: '过去1个月没有' },
+          { value: 'b', label: '每周平均不足1个晚上' },
+          { value: 'c', label: '每周平均1-2个晚上' },
+          { value: 'd', label: '每周平均3个或更多晚上' },
+        ]
+      }],
+    inputValue: '',// 睡眠质量专用
+    intervalId1:null
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    if (options.type) {
+      var type = options.type;
+      var testTitle = "";
+      var testDesc = "";
+      var stepTotal = 1;
+      if (type == "physique") {
+        // 体质
+        testTitle = "体质诊断检测";
+        testDesc = "本测试表由山东省中医药大学中医专家组(具有中医针灸师、中医芳香疗法指导师、医院临床检验科资质的主任医师们)提出。中医学依据气、血、水的平衡状态,将人分为六种体质。要改善身体的“不调”,最重要的就是先了解自己的体质。有人也可能是不同体质混合的“复合型”,而且人的体质日常是变化的,因此应根据每天变化的身体状态进行相应调理的养生疗法。我们根据人体部位分了八个方面,请从下面选项里选出和自己相符的项,提交后,系统会进行判断,并显示您的体质、分析和建议。";
+        stepTotal = this.data.physiqueData.length + 1;
+      } else if (type == "sleep") {
+        // 睡眠质量
+        testTitle = "睡眠质量指数评测";
+        testDesc = "本测评系统依据山东睡眠质量指数量表(SDPSQI)开发。\nSDPSO1由山东省中医药大学医学中心精神科睡眠和生物节律研究中心睡眠专家组编制,专门用于评定被试者近一个月的主观睡眠质量。SDPSQI作为一种科学、系统的睡眠质量评估工具为了解个体睡眠状况、诊断睡眠障碍以及制定相应的干预措施提供了重要的工具和平台。";
+        stepTotal = this.data.sleepData.length + 1;
+      }
+      this.setData({
+        testTitle,
+        testDesc,
+        type,
+        stepTotal
+      })
+    }
+    let hotelTemp = '';
+    let roomTemp = '';
+
+    hotelTemp = wx.getStorageSync('hotelEmpower');
+    roomTemp = wx.getStorageSync('roomEmpower');
+    this.setData({
+      hotel: hotelTemp,
+      room: roomTemp,
+    });
+  },
+  leftBack() {
+    wx.navigateBack()
+  },
+  checkGender(e) {
+    console.log(e.currentTarget.dataset.id);
+    this.setData({
+      gender: e.currentTarget.dataset.id - 0
+    })
+
+  },
+  //单选框
+  handleRadioBox(e) {
+    if (this.data.type == "physique") {
+      // 体质
+
+    } else if (this.data.type == "sleep") {
+      // 睡眠质量
+      var list = this.data.sleepData;
+      var index = e.currentTarget.dataset.index;
+      var subIndex = e.currentTarget.dataset.subindex;
+      var value = list[index].options[subIndex].value;
+      list[index].value = value;
+      this.setData({
+        sleepData: list
+      })
+    }
+  },
+  // 多选框
+  handleCheckBox(e) {
+    console.log(e.currentTarget.dataset);
+    if (this.data.type == "physique") {
+      // 体质
+      var list = this.data.physiqueData;
+      var index = e.currentTarget.dataset.index;
+      var subIndex = e.currentTarget.dataset.subindex;
+      var values = list[index].value || [];
+      var value = list[index].options[subIndex].value;
+      if (values.indexOf(value) >= 0) {
+        values = values.filter((item) => item != value);
+      } else {
+        values.push(value);
+      }
+      list[index].value = values;
+      this.setData({
+        physiqueData: list
+      })
+    } else if (this.data.type == "sleep") {
+      // 睡眠质量
+    }
+  },
+  toNext() {
+    if (this.data.step == 1) {
+      // 判断基本信息是否为空
+    } else {
+      // 判断列表是否有值
+      if (this.data.type == "physique") {
+        // 体质
+        var list = this.data.physiqueData;
+        var index = this.data.step - 2;
+        var values = list[index].value || [];
+        if (values <= 0) {
+          wx.showModal({
+            title: '无法提交',
+            content: '您还有部分题目未完成,请检查后重新提交',
+            showCancel: false,
+            confirmColor: '#0BC3AA',
+            confirmText: "好的",
+            success(res) {
+
+
+            }
+          })
+          return
+        }
+      } else if (this.data.type == "sleep") {
+        // 睡眠质量
+
+        var list = this.data.sleepData;
+        var index = this.data.step - 2;
+        var values = list[index].value;
+        if ((list[index].type == 'radio&input' && this.data.inputValue.length <= 0 && values.length <= 0) || (list[index].type != 'radio&input' && (!values || values.length <= 0))) {
+          wx.showModal({
+            title: '无法提交',
+            content: '您还有部分题目未完成,请检查后重新提交',
+            showCancel: false,
+            confirmColor: '#0BC3AA',
+            confirmText: "好的",
+            success(res) {
+
+
+            }
+          })
+          return
+        }
+      }
+    }
+    if (this.data.step < this.data.stepTotal) {
+      this.setData({
+        step: this.data.step + 1
+      })
+    } else {
+      // 结束了
+      console.log('结束了');
+
+      if (this.data.type == "physique") {
+        // 体质
+        this.commitPhysique();
+      } else if (this.data.type == "sleep") {
+        // 睡眠质量
+        var that = this;
+        wx.showLoading({
+          title: '加载中',
+        })
+        if (!that.data.intervalId1) {
+          that.data.intervalId1 = setInterval(() => {
+            that.commitSleep();
+          }, 1000);
+        }
+      }
+    }
+  },
+  commitPhysique() {
+    var that = this;
+    var list = this.data.physiqueData;
+    let resultMostFrequentLetters = this.findMostFrequentLetters(
+      this.getRemarkValues(list[0].options, list[0].value),
+      this.getRemarkValues(list[1].options, list[1].value),
+      this.getRemarkValues(list[2].options, list[2].value),
+      this.getRemarkValues(list[3].options, list[3].value),
+      this.getRemarkValues(list[4].options, list[4].value),
+      this.getRemarkValues(list[5].options, list[5].value),
+      this.getRemarkValues(list[6].options, list[6].value),
+      this.getRemarkValues(list[7].options, list[7].value)
+    );
+
+    const { nickName } = wx.getStorageSync('userInfo');
+    const unionid = wx.getStorageSync('unionid');
+    
+    let comScoreIndex = [];
+    let _comScoreStatus = "";
+    let _comScoreDesc = ""
+    if (!resultMostFrequentLetters || !Array.isArray(resultMostFrequentLetters) || !resultMostFrequentLetters.length) {
+      comScoreIndex = [];
+      _comScoreStatus = "";
+      _comScoreDesc = ""
+    } else {
+      comScoreIndex = [];
+      // 遍历输入数组  
+      resultMostFrequentLetters.forEach(item => {
+
+        console.log('item=' + item);
+        if (item == 'A') {
+          if (_comScoreStatus) {
+            _comScoreStatus += "\n气虚型";
+          } else {
+            _comScoreStatus += "气虚型";
+          }
+          if (_comScoreDesc) {
+            _comScoreDesc += "\n气虚型:填写内容";
+          } else {
+            _comScoreDesc += "气虚型:填写内容";
+          }
+          comScoreIndex.push(0);
+        } else if (item == 'B') {
+          if (_comScoreStatus) {
+            _comScoreStatus += "\n气滞型";
+          } else {
+            _comScoreStatus += "气滞型";
+          }
+          if (_comScoreDesc) {
+            _comScoreDesc += "\n气滞型:填写内容";
+          } else {
+            _comScoreDesc += "气滞型:填写内容";
+          }
+          comScoreIndex.push(1);
+        } else if (item == 'C') {
+          if (_comScoreStatus) {
+            _comScoreStatus += "\n血虚型";
+          } else {
+            _comScoreStatus += "血虚型";
+          }
+          if (_comScoreDesc) {
+            _comScoreDesc += "\n血虚型:填写内容";
+          } else {
+            _comScoreDesc += "血虚型:填写内容";
+          }
+          comScoreIndex.push(2);
+        } else if (item == 'D') {
+          if (_comScoreStatus) {
+            _comScoreStatus += "\n淤血型";
+          } else {
+            _comScoreStatus += "淤血型";
+          }
+          if (_comScoreDesc) {
+            _comScoreDesc += "\n淤血型:填写内容";
+          } else {
+            _comScoreDesc += "淤血型:填写内容";
+          }
+          comScoreIndex.push(3);
+        } else if (item == 'E') {
+          if (_comScoreStatus) {
+            _comScoreStatus += "\n水虚型";
+          } else {
+            _comScoreStatus += "水虚型";
+          }
+          if (_comScoreDesc) {
+            _comScoreDesc += "\n水虚型:填写内容";
+          } else {
+            _comScoreDesc += "水虚型:填写内容";
+          }
+          comScoreIndex.push(4);
+        } else if (item == 'F') {
+          if (_comScoreStatus) {
+            _comScoreStatus += "\n痰湿型";
+          } else {
+            _comScoreStatus += "痰湿型";
+          }
+          if (_comScoreDesc) {
+            _comScoreDesc += "\n痰湿型:填写内容";
+          } else {
+            _comScoreDesc += "痰湿型:填写内容";
+          }
+          comScoreIndex.push(5);
+        }
+
+      });
+    }
+
+    let surveyData = {
+      hotel: this.data.hotel,
+      room: this.data.room,
+      userId: nickName,
+      id2: unionid,
+      bodySynthesis: this.getFormattedString(list[0].value, list[0].options),
+      facialFeatures: this.getFormattedString(list[1].value, list[1].options),
+      skinHair: this.getFormattedString(list[2].value, list[2].options),
+      emotion: this.getFormattedString(list[3].value, list[3].options),
+      menstruation: this.getFormattedString(list[4].value, list[4].options),
+      character: this.getFormattedString(list[5].value, list[5].options),
+      sleep: this.getFormattedString(list[6].value, list[6].options),
+      //舌头状态是新增加项,赋给value1了,数据库里有value1...value8,以备增加项用
+      value1: this.getFormattedString(list[7].value, list[7].options),
+      //value2 保存A、B、C、D、E、F 每个的个数
+      value2: JSON.stringify(countABCDEF),
+      comScoreStatus: _comScoreStatus ? _comScoreStatus : '健康型',
+      comScoreIndex: comScoreIndex,
+      comScoreDesc: _comScoreDesc,
+    };
+    var maxValueObj = that.findMaxValueKeyAndIndex(countABCDEF);
+    console.log(countABCDEF);
+    console.log(maxValueObj);
+    
+    // 体质提交
+    if (!that.data.intervalId1) {
+      that.data.intervalId1 = setInterval(() => {
+        //提交到数据库
+        wx.request({
+          url: `${homeApi}/system/constitutionDiagnosis`, //
+          method: 'POST',
+          header: {
+            'content-type': 'application/json', // 默认值
+            'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+          },
+          data: surveyData,
+          success(res) {
+            console.log('res===' + JSON.stringify(res));
+            console.log('res.code===' + res.code);
+            if (res && res.data && res.data.code == 200) {
+              if (that.data.intervalId1) {
+                clearInterval(that.data.intervalId1);
+                that.data.intervalId1 = null;
+              }
+              wx.showToast({
+                title: '问卷提交成功',
+                icon: 'success',
+                duration: 2000,
+                success() {
+                  setTimeout(() => {
+                    wx.redirectTo({
+                      url: `/subpages/testResultB/testResultB?comScoreIndex=${maxValueObj.index}`
+                    })
+                  }, 1000);
+                }
+              });
+
+            }
+          },
+          fail: function (error) {
+            console.error('error', error);
+          },
+          complete: function (e) {
+          }
+        });
+      }, 1000);
+    }
+  },
+  commitSleep() {
+    // 睡眠质量提交
+    var that = this;
+    const { nickName } = wx.getStorageSync('userInfo');
+    const unionid = wx.getStorageSync('unionid');
+    const answerJson = this.data.sleepData;
+    let value1 = answerJson[0].value;
+    let value2 = answerJson[1].value;
+    let value3 = answerJson[2].value;
+    let value4 = answerJson[3].value;
+    let value5a = answerJson[4].value;
+    let value5b = answerJson[5].value;
+    let value5c = answerJson[6].value;
+    let value5d = answerJson[7].value;
+    let value5e = answerJson[8].value;
+    let value5f = answerJson[9].value;
+    let value5g = answerJson[10].value;
+    let value5h = answerJson[11].value;
+    let value5i = answerJson[12].value;
+    let value5j = answerJson[13].value;
+    let value5jDes = '';//这个值没有算
+    let value6 = answerJson[14].value;
+    let value7 = answerJson[15].value;
+    let value8 = answerJson[16].value;
+    let value9 = answerJson[17].value;
+    let value10 = answerJson[18].value;
+    let value11 = answerJson[19].value;
+    let value12 = answerJson[20].value;
+    let value13 = answerJson[21].value;
+    let value14 = answerJson[22].value;
+    let value15 = answerJson[23].value;
+    let value15Des = that.data.inputValue;//这个值没有算
+
+    //计算规则  https://mp.weixin.qq.com/s/QyTzuPoNErMjc2KcA1M61g
+    let comA = 0;//条目6
+    let comB = 0;
+    let comB1 = 0;
+    let comC = 0;
+    let comD = 0;
+    let comE = 0;
+    let comF = 0;
+    let comG = 0;
+
+    comA = this.resultABCD(value6);
+    comB1 = this.resultABCD(value2) + this.resultABCD(value5a);
+    if (comB1 == 0) {
+      comB = 0;
+    } else if (comB1 >= 1 && comB1 <= 2) {
+      comB = 1;
+    } else if (comB1 >= 3 && comB1 <= 4) {
+      comB = 2;
+    } else if (comB1 >= 5 && comB1 <= 6) {
+      comB = 3;
+    }
+    let value41 = parseInt((value4.split(':')[0]), 10) || 0;
+    let value42 = parseInt((value4.split(':')[1]), 10) || 0;
+    let value43 = value41 * 60 + value42;
+    if (value43 > 420) {
+      comC = 0;
+    } else if (value43 >= 360 && value43 <= 420) {
+      comC = 1;
+    } else if (value43 >= 300 && value43 < 360) {
+      comC = 2;
+    } else if (value43 < 300) {
+      comC = 3;
+    }
+
+
+    let datediff = this.calculateTimeDifference(value1, value3);
+    let sleepRate = datediff ? ((value43 / datediff) * 100) : 0;
+    if (sleepRate >= 85) {
+      comD = 0;
+    } else if (sleepRate >= 75 && sleepRate <= 84) {
+      comD = 1;
+    } else if (sleepRate >= 65 && sleepRate < 74) {
+      comD = 2;
+    } else if (sleepRate < 65) {
+      comD = 3;
+    }
+
+    let value5All = this.resultABCD(value5b)
+      + this.resultABCD(value5c)
+      + this.resultABCD(value5d)
+      + this.resultABCD(value5e)
+      + this.resultABCD(value5f)
+      + this.resultABCD(value5g)
+      + this.resultABCD(value5h)
+      + this.resultABCD(value5i)
+      + this.resultABCD(value5j);
+    if (value5All == 0) {
+      comE = 0;
+    } else if (value5All >= 1 && value5All <= 9) {
+      comE = 1;
+    } else if (value5All >= 10 && value5All <= 18) {
+      comE = 2;
+    } else if (value5All >= 19 && value5All <= 27) {
+      comE = 3;
+    }
+
+    comF = this.resultABCD(value7);
+    let valueGAll = this.resultABCD(value8) + this.resultABCD(value9);
+    if (valueGAll == 0) {
+      comG = 0;
+    } else if (valueGAll >= 1 && valueGAll <= 2) {
+      comG = 1;
+    } else if (valueGAll >= 3 && valueGAll <= 4) {
+      comG = 2;
+    } else if (valueGAll >= 5 && valueGAll <= 6) {
+      comG = 3;
+    }
+
+
+    let comAll = comA + comB + comC + comD + comE + comF + comG;
+    let comScoreIndex = 0;
+    let _comScoreStatus = "";
+    let _comScoreDesc = "";
+    if (comAll >= 0 && comAll <= 5) {
+      _comScoreStatus = "非常好";
+    } else if (comAll >= 6 && comAll <= 10) {
+      _comScoreStatus = "良好";
+      comScoreIndex = 1;
+    } else if (comAll >= 11 && comAll <= 15) {
+      _comScoreStatus = "一般";
+      comScoreIndex = 2;
+    } else {
+      // if (comAll >= 16 && comAll <= 21) 
+      _comScoreStatus = "差";
+      comScoreIndex = 3;
+    }
+
+    if (this.judgmentScoreRange(comAll, 0, 5)) {
+      _comScoreDesc = "你目前的睡眠质量非常高,而且健康状况良好,这一切应该继续保持下去。"
+    } else if (this.judgmentScoreRange(comAll, 6, 10)) {
+      _comScoreDesc = "你的睡眠质量平平,健康状况也受到影响, 如果再不引起你对睡眠质量的足够重视, 那么你的睡眠质量很可能会迅速下降,向下一级别发展。"
+    } else if (this.judgmentScoreRange(comAll, 11, 15)) {
+      _comScoreDesc = "如果你在这一级别内,那么你的睡眠质量可 就亮起红灯了。你必须警惕,因为你的睡眠质量确实比较糟糕,健康状况明显受损。饮食起居会受到一定影响,甚至部分工作你都开始感觉吃力。"
+    } else {
+      _comScoreDesc = "天啊!你的睡眠质量已经到了令人发指的地 步—长期睡眠不足导致了你的健康状况严重恶化,这就是你工作力不从心,情绪起伏不定的原因。"
+    }
+    let surveyData = {
+      hotel: this.data.hotel,
+      room: this.data.room,
+      userId: nickName,
+      id2: unionid,
+      value1: value1,
+      value2: value2,
+      value3: value3,
+      value4: value4,
+      value5a: value5a,
+      value5b: value5b,
+      value5c: value5c,
+      value5d: value5d,
+      value5e: value5e,
+      value5f: value5f,
+      value5g: value5g,
+      value5h: value5h,
+      value5i: value5i,
+      value5j: value5j,
+      value5jDes: value5jDes,
+      value6: value6,
+      value7: value7,
+      value8: value8,
+      value9: value9,
+      value10: value10,
+      value11: value11,
+      value12: value12,
+      value13: value13,
+      value14: value14,
+      value15: value15,
+      value15Des: value15Des,
+      value16: comAll,//备用16(评分)
+      value17: _comScoreStatus,//备用17(评分说明)
+      value18: _comScoreDesc,
+      value18: comA + ',' + comB + ',' + comC + ',' + comD + ',' + comE + ',' + comF + ',' + comG //备用18(comA、comB、comC、comD、comE、comF、comG)
+    };
+
+
+    //提交到数据库
+    wx.request({
+      url: `${homeApi}/system/questionInvest`, //
+      method: 'POST',
+      header: {
+        'content-type': 'application/json', // 默认值
+        'Authorization': 'Bearer ' + token // 在头部设置认证信息,例如使用Bearer Token
+      },
+      data: surveyData,
+      success(res) {
+        console.log('res===' + JSON.stringify(res));
+        console.log('res.code===' + res.data.code);
+        if (res && res.data && res.data.code == 200) {
+          wx.hideLoading();
+          if (that.data.intervalId1) {
+            clearInterval(that.data.intervalId1);
+            that.data.intervalId1 = null;
+          }
+          wx.showToast({
+            title: '问卷提交成功',
+            icon: 'success',
+            duration: 2000,
+            success() {
+              setTimeout(() => {
+                wx.redirectTo({
+                  url: `/subpages/testResultA/testResultA?comScore=${comAll}`
+                })
+              }, 1000);
+            }
+          });
+        }
+      },
+      fail: function (error) {
+        console.error('error', error);
+      },
+      complete: function (e) {
+      }
+    });
+  },
+  handleSelectDate(event) {
+    var item = event.currentTarget.dataset.item;
+    const value = item.value || "";
+    this.setData({ currentDateItem: item, currentDate: value, showDateDialog: true });
+
+    console.log(this.data.currentDateItem);
+  },
+  onCloseDateDialog() {
+    this.setData({ showDateDialog: false, currentDateItem: null });
+  },
+  onCloseResultsDialog() {
+    this.setData({ promptTextMessageFlag: false });
+  },
+  onDateInput(event) {
+    const item = this.data.currentDateItem;
+    if (!item) {
+      return
+    }
+
+    if (this.data.type == "physique") {
+      // 体质
+
+    } else if (this.data.type == "sleep") {
+      // 睡眠质量
+      let sleepData = this.data.sleepData;
+
+      for (let i = 0; i < sleepData.length; i++) {
+        const element = sleepData[i];
+        if (element.id == item.id) {
+          element.value = event.detail;
+          break;
+        }
+      }
+      console.log(event);
+
+
+      this.setData({
+        sleepData: sleepData
+      });
+    }
+
+    this.onCloseDateDialog()
+  },
+  // 睡眠质量的方法
+  resultABCD: function (a) {
+    if (a == 'a') {
+      return 0;
+    } else if (a == 'b') {
+      return 1;
+    } else if (a == 'c') {
+      return 2;
+    } else if (a == 'd') {
+      return 3;
+    }
+  },
+
+  judgmentScoreRange(scoreValue, startScore, endScore) {
+    return scoreValue >= startScore && scoreValue <= endScore;
+  },
+  // 将时间字符串转换为分钟数  
+  timeStringToMinutes: function (timeStr) {
+    var parts = timeStr.split(":");
+    return parseInt(parts[0], 10) * 60 + parseInt(parts[1], 10);
+  },
+  // 计算时间差(分钟)  
+  calculateTimeDifference: function (sleepTimeStr, wakeUpTimeStr) {
+    // 将时间字符串转换为分钟  
+    var sleepTimeMinutes = this.timeStringToMinutes(sleepTimeStr);
+    var wakeUpTimeMinutes = this.timeStringToMinutes("24:00") + this.timeStringToMinutes(wakeUpTimeStr); // 加上第二天的0点到起床时间的分钟数  
+
+    // 计算时间差  
+    var diffInMinutes = wakeUpTimeMinutes - sleepTimeMinutes;
+
+    // 将分钟数转换回时间字符串格式 HH:mm  
+    var diffInHours = Math.floor(diffInMinutes / 60);
+    var diffInMins = diffInMinutes % 60;
+
+    // 返回时间差字符串  
+    return diffInMinutes;
+  },
+  // 体质的方法
+  // 取出最大值的obj
+  findMaxValueKeyAndIndex(obj) {
+    if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
+      throw new Error('Input must be a plain object');
+    }
+    let maxKey = null;
+    let maxValue = 0;
+    let maxIndex = 6;
+
+    const keys = Object.keys(obj);
+    keys.forEach((key, index) => {
+      const value = obj[key];
+      if (value > maxValue) {
+        maxValue = value;
+        maxKey = key;
+        maxIndex = index;
+      }
+    });
+
+    return {
+      key: maxKey,
+      value: maxValue,
+      index: maxIndex
+    };
+  },
+  /**
+   * A、B、C、D、E、F 最后积累的数量对比,按数量多少来判断,6个分别对应:气虚型、气滞型、血虚型、淤血型、水虚型、痰湿型
+ * 找出对象中值最大的键
+ * @param {Object} obj - 包含键值对的对象
+ * @returns {string|null} - 值最大的键,如果没有找到则返回null
+ */
+  findKeyWithMaxValue(obj) {
+    if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
+      throw new Error('Input must be a plain object');
+    }
+
+    let maxKey = null;
+    let maxValue = 0;
+
+    for (let key in obj) {
+      if (obj.hasOwnProperty(key)) {
+        if (obj[key] > maxValue) {
+          maxValue = obj[key];
+          maxKey = key;
+        }
+      }
+    }
+
+    return maxKey;
+  },
+  areAllArraysEmpty: function (arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8) {
+    // 定义一个数组来包含所有传入的数组  
+    const arrays = [arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8];
+
+    // 遍历这个数组,检查每一项(即传入的数组)是否为空  
+    for (let i = 0; i < arrays.length; i++) {
+      // 检查当前数组是否为空(即长度为0)  
+      if (arrays[i] && arrays[i].length > 0) {
+        // 如果发现任何一个数组不为空,则返回false  
+        return false;
+      }
+    }
+
+    // 如果所有数组都检查过了,且都是空的,则返回true  
+    return true;
+  },
+
+  //统计这8个数组,总共包含A,B,C,D,E,F的个数,返回最多的一项(也可能多项):
+  //如果有多个 最多 的情况,返回最多的几个,如果都是0或者空,返回空
+  findMostFrequentLetters: function (arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8) {
+
+    //判断6个数组是否都为空
+    if (this.areAllArraysEmpty(arr1, arr2, arr3, arr4, arr5, arr6, arr7, arr8))
+      return '';
+    // 初始化一个对象来存储每个字母的计数  
+    const letterCounts = {
+      A: 0,
+      B: 0,
+      C: 0,
+      D: 0,
+      E: 0,
+      F: 0
+    };
+
+    // 定义一个辅助函数来更新计数  
+    function updateCounts(arr) {
+      if (Array.isArray(arr)) {
+        arr.forEach(item => {
+          if (typeof item === 'string' && ['A', 'B', 'C', 'D', 'E', 'F'].includes(item)) {
+            letterCounts[item]++;
+          }
+        });
+      }
+    }
+
+    // 对每个数组调用辅助函数  
+    updateCounts(arr1);
+    updateCounts(arr2);
+    updateCounts(arr3);
+    updateCounts(arr4);
+    updateCounts(arr5);
+    updateCounts(arr6);
+    updateCounts(arr7);
+    updateCounts(arr8);
+
+
+    countABCDEF = letterCounts;
+    // 找出出现次数最多的字母及其计数  
+    let maxCount = 0;
+    let mostFrequentLetters = [];
+
+    for (let letter in letterCounts) {
+      if (letterCounts[letter] == 0) {
+        continue;
+      }
+      if (letterCounts[letter] > maxCount) {
+        maxCount = letterCounts[letter];
+        mostFrequentLetters = [letter]; // 重置为当前最多的字母  
+      } else if (letterCounts[letter] === maxCount) {
+        mostFrequentLetters.push(letter); // 如果计数相同,则添加到列表中  
+      }
+    }
+
+    // 如果所有字母的计数都是0或数组为空,则返回空  
+    if (mostFrequentLetters.length === 0) {
+      return '';
+    }
+
+    // 返回出现次数最多的字母或字母集合  
+    return mostFrequentLetters;
+  },
+  //根据第二个数组对应第一个数组的value列,取第一个数组的remark的值,组成新的数组
+  getRemarkValues: function (options, values) {
+    if (!options || options.length === 0 || !values || values.length === 0) {
+      return [];
+    }
+    // 初始化一个空数组来存储结果  
+    let remarkValues = [];
+
+    // 遍历values数组  
+    values.forEach(value => {
+      // 遍历options数组  
+      options.forEach(option => {
+        // 如果找到了对应的value,则将该option的remark添加到result数组中  
+        if (option.value == value) {
+          remarkValues.push(option.remark);
+        }
+      });
+    });
+    // 返回包含所有remark值的数组  
+    return remarkValues;
+  },
+  getFormattedString: function (arr1, arr2) {
+    // 检查 arr1 和 arr2 是否为非空数组  
+    if (!arr1 || !arr2 || !Array.isArray(arr1) || arr1.length === 0 || !Array.isArray(arr2) || arr2.length === 0) {
+      return '';
+    }
+    let result = '';
+    arr1.forEach(value => {
+      const valueStr = value ? value.toString() : '';
+      const item = arr2.find(obj => obj.value == valueStr);
+      if (item) {
+        result += ` ${item.remark}、${item.label} char10`;
+      }
+    });
+    return result;
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+    var that = this;
+    if (that.data.intervalId1) {
+      clearInterval(that.data.intervalId1);
+      that.data.intervalId1 = null;
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+    var that = this;
+    if (that.data.intervalId1) {
+      clearInterval(that.data.intervalId1);
+      that.data.intervalId1 = null;
+    }
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 4 - 0
subpages/textStep/textStep.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "测评步骤",
+  "navigationStyle": "custom"
+}

+ 119 - 0
subpages/textStep/textStep.wxml

@@ -0,0 +1,119 @@
+<!--subpages/textStep/textStep.wxml-->
+
+
+<view>
+  <van-nav-bar title="" left-text="" leftArrow custom-class="nav-bar" bind:click-left="leftBack"></van-nav-bar>
+  <text class="page-title">{{testTitle}}</text>
+
+  <view class="progressBar-box">
+    <view class="progressBar-bg">
+      <view class="progressBar-progress" style="{{'width:calc(100% / '+stepTotal+' * '+step+');'}}"></view>
+    </view>
+    <text class="progressBar-progressText">{{step}}</text>
+    <text class="progressBar-progressTotal">/{{stepTotal}}</text>
+  </view>
+  <!-- 报告第一步 确认基本信息 -->
+  <view wx:if="{{step == 1}}" class="w-card">
+    <view class="base-title-view">
+      <view class="base-title-line" />
+      <text class="base-title">您的性别</text>
+    </view>
+    <view class="v1">
+      <view data-id="1" bindtap="checkGender">
+        <image wx:if="{{gender == 1}}" src="/subpages/images//testRes/ic_test_man_check.png"></image>
+        <image wx:else src="/subpages/images//testRes/ic_test_man.png"></image>
+      </view>
+      <view data-id="2" bindtap="checkGender">
+        <image wx:if="{{gender == 2}}" src="/subpages/images//testRes/ic_test_women_check.png"></image>
+        <image wx:else src="/subpages/images//testRes/ic_test_women.png"></image>
+      </view>
+    </view>
+    <view class="v2">
+      <view class="v3">
+        <text class="t1">您的年龄</text>
+        <view class="v4">
+          <van-field model:value="{{ age }}" placeholder="" inputAlign="center" type="number" maxlength="4"
+            custom-style="border-bottom:2rpx solid #EEEEEE;font-size:40rpx;font-weight:600;" />
+          <text class="t2">岁</text>
+        </view>
+      </view>
+      <view class="v3">
+        <text class="t1">您的身高</text>
+        <view class="v4">
+          <van-field model:value="{{ height }}" placeholder="" inputAlign="center" type="number" maxlength="4"
+            custom-style="border-bottom:2rpx solid #EEEEEE;font-size:40rpx;font-weight:600;" />
+          <text class="t2">厘米</text>
+        </view>
+      </view>
+      <view class="v3" style="margin-bottom: 20rpx;">
+        <text class="t1">您的体重</text>
+        <view class="v4">
+          <van-field model:value="{{ weight }}" placeholder="" inputAlign="center" type="number" maxlength="4"
+            custom-style="border-bottom:2rpx solid #EEEEEE;font-size:40rpx;font-weight:600;" />
+          <text class="t2">公斤</text>
+        </view>
+      </view>
+      <view class="v3">
+      </view>
+    </view>
+  </view>
+  <!-- 报告其他步骤 -->
+  <view wx:else>
+    <wxs module="jstools" src="/subpages/wxs/includes.wxs"></wxs>
+    <view class="w-card" wx:for="{{type == 'sleep' ? sleepData : physiqueData}}" wx:key="index"
+      wx:if="{{index == step - 2}}">
+      <view class="base-title-view">
+        <view class="base-title-line" />
+        <text class="base-title">{{item.title}}</text>
+      </view>
+      <scroll-view type="list" scroll-y style="max-height: calc(100vh - 670rpx)">
+        <view>
+          <view wx:if="{{item.type == 'checkbox'}}" class="options">
+            <text wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
+              class="{{jstools.includes(item.value,subItem.value) ?   'option option.active' :'option' }}"
+              data-index="{{index}}" data-subindex="{{subIndex}}" bindtap="handleCheckBox">{{subItem.label}}</text>
+          </view>
+          <view wx:elif="{{item.type == 'date'}}" class="options-date">
+            <view wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
+              class="{{item.value.length ?   'option option-date option.active' :'option option-date' }}"
+              data-index="{{index}}" data-subindex="{{subIndex}}" data-item="{{item}}" bindtap="handleSelectDate">
+              <text style="flex: 1;">{{subItem.label}}</text>
+              <text>{{item.value}}</text>
+              <van-icon name="arrow" />
+            </view>
+          </view>
+          <view wx:if="{{item.type == 'radio'}}" class="options">
+            <view wx:if="{{item.subTitle}}"
+              style="display: flex;flex-direction: row;margin-left: 40rpx;margin-top: 10rpx;margin-bottom: 10rpx;">
+              <text class="t1">{{item.subTitle}}</text>
+            </view>
+            <text wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
+              class="{{item.value == subItem.value ?   'option option.active' :'option' }}" data-index="{{index}}"
+              data-subindex="{{subIndex}}" bindtap="handleRadioBox">{{subItem.label}}</text>
+          </view>
+          <view wx:if="{{item.type == 'radio&input'}}" class="options">
+            <text wx:for="{{item.options}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
+              class="{{item.value == subItem.value ?   'option option.active' :'option' }}" data-index="{{index}}"
+              data-subindex="{{subIndex}}" bindtap="handleRadioBox">{{subItem.label}}</text>
+            <view wx:if="{{item.subTitle}}"
+              style="display: flex;flex-direction: row;margin-left: 40rpx;margin-top: 20rpx;margin-bottom: 10rpx;align-items: center;">
+              <text class="t1">{{item.subTitle}}</text>
+              <van-field model:value="{{ inputValue }}" placeholder="请输入" inputAlign="left"
+                custom-style="border-bottom:2rpx solid #EEEEEE;font-size:28rpx;margin-left: 30rpx;" />
+            </view>
+          </view>
+        </view>
+      </scroll-view>
+    </view>
+  </view>
+  <view class="bottom-btn-view">
+    <text class="view-res-btn" bindtap="toNext">{{step == stepTotal ? '提交' : '下一步'}}</text>
+  </view>
+  <van-popup wx:if="{{currentDateItem}}" show="{{ showDateDialog }}" close-on-click-overlay z-index="10086" overlay
+    position="bottom" bind:close="onCloseDateDialog" custom-class="custom-date-class"
+    bind:click-overlay="onCloseDateDialog">
+    <van-datetime-picker type="time" formatter="{{ formatter }}" title="{{currentDateItem.label}}"
+      value="{{ currentDate }}" min-hour="0" max-hour="23" bind:confirm="onDateInput" bind:cancel="onCloseDateDialog"
+      toolbar-class="toolbar-class" />
+  </van-popup>
+</view>

+ 277 - 0
subpages/textStep/textStep.wxss

@@ -0,0 +1,277 @@
+/* subpages/textStep/textStep.wxss */
+page {
+  background: linear-gradient(180deg, #D6E8FE 0%, #FFFFFF 100%);
+
+  --cell-background-color: transparent;
+}
+
+.nav-bar {
+  --nav-bar-icon-color: black !important;
+  width: 100vw;
+  background-color: transparent !important;
+  background: transparent !important;
+  position: sticky;
+  top: 0;
+  left: 0;
+}
+
+.page-title {
+  margin-left: 40rpx;
+  font-weight: 600;
+  font-size: 38rpx;
+  color: #222222;
+}
+
+
+.bottom-btn-view {
+  position: fixed;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  width: 100%;
+  height: 180rpx;
+  background: #FFFFFF;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: flex-start;
+}
+
+
+.view-res-btn {
+  margin-top: 16rpx;
+  width: 336rpx;
+  height: 84rpx;
+  background: #EFF7FF;
+  text-align: center;
+  border-radius: 84rpx;
+  line-height: 84rpx;
+  font-size: 32rpx;
+  color: #1E8BFF;
+  font-weight: bold;
+}
+
+.view-res-btn:active {
+  opacity: 0.7;
+}
+
+
+.w-card {
+  display: flex;
+  flex-direction: column;
+  margin-top: 20rpx;
+  margin-left: auto;
+  margin-right: auto;
+  margin-bottom: 200rpx;
+  padding-bottom: 40rpx;
+  width: 710rpx;
+  box-shadow: 0rpx 8rpx 20rpx 0rpx #D3E0F4;
+  border-radius: 24rpx;
+  background: linear-gradient(90deg, #F8FBFF 4%, #FFFFFF 100%);
+}
+
+.base-title-view {
+  margin-left: auto;
+  margin-right: auto;
+  margin-top: 40rpx;
+  width: calc(100% - 20rpx);
+  display: flex;
+  flex-direction: row;
+}
+
+.base-title-line {
+  width: 6rpx;
+  margin-top: 6rpx;
+  margin-right: 20rpx;
+  margin-left: 30rpx;
+  height: 28rpx;
+  background: #1E8BFF;
+  border-radius: 4rpx;
+}
+
+.base-title {
+  flex: 1;
+  font-weight: 400;
+  font-size: 28rpx;
+  color: #333333;
+}
+
+.progressBar-box {
+  width: calc(100% - 80rpx);
+  margin-top: 20rpx;
+  margin-left: 40rpx;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.progressBar-bg {
+  flex: 1;
+  height: 16rpx;
+  background: #CCE4FC;
+  border-radius: 8rpx;
+  display: flex;
+  align-items: center;
+  overflow: hidden;
+  flex-direction: row;
+}
+
+.progressBar-progress {
+  border-radius: 8rpx;
+  width: calc(100% / 8);
+  height: 16rpx;
+  background: linear-gradient(90deg, #1E8BFF 0%, #70B7FF 100%);
+}
+
+.progressBar-progressText {
+  min-width: 50rpx;
+  text-align: right;
+  font-size: 32rpx;
+  color: #1E8BFF;
+}
+
+.progressBar-progressTotal {
+  font-size: 32rpx;
+  color: #555555;
+}
+
+.v1 {
+  margin-top: 40rpx;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-evenly;
+}
+
+.v1 image {
+  display: flex;
+  width: 112rpx;
+  height: 112rpx;
+}
+
+.v2 {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-evenly;
+  flex-direction: row;
+}
+
+.v3 {
+  margin-top: 60rpx;
+  width: 286rpx;
+  display: flex;
+  flex-direction: column;
+}
+
+.v4 {
+  --cell-horizontal-padding: 0;
+  display: flex;
+  flex-wrap: nowrap;
+  flex-direction: row;
+  align-items: baseline;
+}
+
+.t2 {
+  min-width: 70rpx;
+}
+
+.options {
+  margin-top: 20rpx;
+  display: flex;
+  flex-direction: column;
+}
+
+.options-date {
+  margin-top: 20rpx;
+  display: flex;
+  flex-direction: row;
+}
+
+.option {
+  margin-top: 20rpx;
+  margin-left: auto;
+  margin-right: auto;
+  width: 570rpx;
+  background: #F7F8FD;
+  padding: 28rpx 30rpx;
+  border-radius: 16rpx;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+  font-size: 28rpx;
+  color: #333333;
+}
+
+.option.active {
+  background: linear-gradient(90deg, #1E8BFF 0%, #70B7FF 100%);
+  color: #FFFFFF;
+}
+
+.option-date {
+  display: flex;
+  flex-direction: row;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.van-datetime-picker {
+  border-radius: 24rpx 24rpx 0px 0px !important;
+  overflow: hidden;
+  background-color: #f0f0f0;
+}
+
+.van-picker {
+  border-radius: 24rpx 24rpx 0px 0px !important;
+  overflow: hidden;
+  background: white !important;
+}
+
+.toolbar-class {
+  border-radius: 24rpx 24rpx 0px 0px !important;
+  overflow: hidden;
+  background: #ECFAF7 !important;
+}
+
+.van-picker__confirm {
+  padding: 0 !important;
+  margin: 0 16px;
+  font-size: 28rpx !important;
+  color: #0BC3AA !important;
+}
+
+.van-picker__cancel {
+  padding: 0 !important;
+  margin: 0 16px;
+  font-size: 28rpx !important;
+  color: #666666 !important;
+}
+
+
+.custom-date-class {
+  position: fixed;
+  box-sizing: border-box;
+  max-height: 100%;
+  overflow-y: auto;
+  transition-timing-function: ease;
+  -webkit-animation: ease both;
+  animation: ease both;
+  -webkit-overflow-scrolling: touch;
+  background-color: white !important;
+  border-radius: 24rpx 24rpx 0px 0px !important;
+  overflow: hidden;
+}
+
+.van-picker-column__item {
+  color: #666666 !important;
+  font-size: 32rpx !important;
+}
+
+.van-picker-column__item--selected {
+  color: #333333 !important;
+  font-size: 40rpx !important;
+}
+
+.t1 {
+  font-size: 28rpx;
+  color: #333333;
+}

+ 0 - 537
typings/wx.d.ts

@@ -510,543 +510,6 @@ declare var wx: {
         complete?: Function;
     }): void;
                     
-    /**
-     * 创建一个 WebSocket 连接;一个微信小程序同时只能有一个 WebSocket 连接,如果当前已存在一个 WebSocket 连接,会自动关闭该连接,并重新创建一个 WebSocket 连接。
-     */
-    connectSocket(obj: {
-        /**
-         * 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名
-         */
-        url: string;
-        /**
-         * 请求的数据
-         */
-        data?: any;
-        /**
-         * HTTP Header , header 中不能设置 Referer
-         */
-        header?: any;
-        /**
-         * 默认是GET,有效值: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
-         */
-        method?: string;
-        /**
-         * 子协议数组
-         */
-        protocols?: string[];
-        /**
-         * // generate time:2017-08-23 21:12:06 
-// Type definitions for wx app
-// Definitions by: hellopao <https://github.com/hellopao/wx.d.ts>
-
-/************************************************
-*                                               *
-*                 微信小程序  API                *
-*                                               *
-************************************************/
-
-interface IAnimation {
-    /**
-     * 透明度,参数范围 0~1
-     */
-    opacity(value: number): IAnimation;
-    /**
-     * 颜色值
-     */
-    backgroundColor(color: string): IAnimation;
-    /**
-     * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
-     */
-    width(length: number): IAnimation;
-    /**
-     * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
-     */
-    height(length: number): IAnimation;
-    /**
-     * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
-     */
-    top(length: number): IAnimation;
-    /**
-     * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
-     */
-    left(length: number): IAnimation;
-    /**
-     * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
-     */
-    bottom(length: number): IAnimation;
-    /**
-     * 长度值,如果传入 Number 则默认使用 px,可传入其他自定义单位的长度值
-     */
-    right(length: number): IAnimation;
-    /**
-     * deg的范围-180~180,从原点顺时针旋转一个deg角度
-     */
-    rotate(deg: number): IAnimation;
-    /**
-     * deg的范围-180~180,在X轴旋转一个deg角度
-     */
-    rotateX(deg: number): IAnimation;
-    /**
-     * deg的范围-180~180,在Y轴旋转一个deg角度
-     */
-    rotateY(deg: number): IAnimation;
-    /**
-     * deg的范围-180~180,在Z轴旋转一个deg角度
-     */
-    rotateZ(deg: number): IAnimation;
-    /**
-     * 同transform-function rotate3d
-     */
-    rotate3d(x: number, y: number, z: number, deg: number): IAnimation;
-    /**
-     * 一个参数时,表示在X轴、Y轴同时缩放sx倍数;两个参数时表示在X轴缩放sx倍数,在Y轴缩放sy倍数
-     */
-    scale(sx: number, sy?: number): IAnimation;
-    /**
-     * 在X轴缩放sx倍数
-     */
-    scaleX(sx: number): IAnimation;
-    /**
-     * 在Y轴缩放sy倍数
-     */
-    scaleY(sy: number): IAnimation;
-    /**
-     * 在Z轴缩放sy倍数
-     */
-    scaleZ(sz: number): IAnimation;
-    /**
-     * 在X轴缩放sx倍数,在Y轴缩放sy倍数,在Z轴缩放sz倍数
-     */
-    scale3d(sx: number, sy: number, sz: number): IAnimation;
-    /**
-     * 一个参数时,表示在X轴偏移tx,单位px;两个参数时,表示在X轴偏移tx,在Y轴偏移ty,单位px。
-     */
-    translate(tx: number, ty?: number): IAnimation;
-    /**
-     * 在X轴偏移tx,单位px
-     */
-    translateX(tx: number): IAnimation;
-    /**
-     * 在Y轴偏移tx,单位px
-     */
-    translateY(tx: number): IAnimation;
-    /**
-     * 在Z轴偏移tx,单位px
-     */
-    translateZ(tx: number): IAnimation;
-    /**
-     * 在X轴偏移tx,在Y轴偏移ty,在Z轴偏移tz,单位px
-     */
-    translate3d(tx: number, ty: number, tz: number): IAnimation;
-    /**
-     * 参数范围-180~180;一个参数时,Y轴坐标不变,X轴坐标延顺时针倾斜ax度;两个参数时,分别在X轴倾斜ax度,在Y轴倾斜ay度
-     */
-    skew(ax: number, ay?: number): IAnimation;
-    /**
-     * 参数范围-180~180;Y轴坐标不变,X轴坐标延顺时针倾斜ax度
-     */
-    skewX(ax: number): IAnimation;
-    /**
-     * 参数范围-180~180;X轴坐标不变,Y轴坐标延顺时针倾斜ay度
-     */
-    skewY(ay: number): IAnimation;
-    /**
-     * 同transform-function matrix
-     */
-    matrix(a, b, c, d, tx, ty): IAnimation;
-    /**
-     * 同transform-function matrix3d
-     */
-    matrix3d(): IAnimation;
-}
-
-interface ICanvasContext {
-    /**
-     * 设置填充色, 如果没有设置 fillStyle,默认颜色为 black。
-     */
-    setFillStyle(color: string): void;
-    /**
-     * 设置边框颜色, 如果没有设置 fillStyle,默认颜色为 black。
-     */
-    setStrokeStyle(color: string): void;
-    /**
-     * 设置阴影
-     */
-    setShadow(offsetX: number, offsetY: number, blur: number, color: string): void;
-    /**
-     * 创建一个线性的渐变颜色。需要使用 addColorStop() 来指定渐变点,至少要两个。
-     */ 
-    createLinearGradient(x0: number, y0: number, x1: number, y1: number): void;
-    /**
-     * 创建一个圆形的渐变颜色。 起点在圆心,终点在圆环。 需要使用 addColorStop() 来指定渐变点,至少要两个。
-     */
-    createCircularGradient(x: number, y: number, r: number): void;
-    /**
-     * 创建一个颜色的渐变点。小于最小 stop 的部分会按最小 stop 的 color 来渲染,大于最大 stop 的部分会按最大 stop 的 color 来渲染。需要使用 addColorStop() 来指定渐变点,至少要两个。
-     */
-    addColorStop(stop: number, color: string): void;
-    /**
-     * 设置线条端点的样式
-     */
-    setLineCap(lineCap: 'butt' | 'round' | 'square'): void;
-    /**
-     * 设置两线相交处的样式
-     */
-    setLineJoin(lineJoin: 'bevel' | 'round' | 'miter'): void;
-    /**
-     * 设置线条宽度
-     */
-    setLineWidth(lineWidth: number): void;
-    /**
-     * 设置最大倾斜
-     */
-    setMiterLimit(miterLimit: number): void;
-    /**
-     * 添加一个矩形路径到当前路径。
-     */
-    rect(x: number, y: number, width: number, height: number): void;
-    /** 
-     * 填充一个矩形。用 setFillStyle() 设置矩形的填充色,如果没设置默认是黑色。
-     */
-    fillRect(x: number, y: number, width: number, height: number): void;
-    /** 
-     * 一个矩形(非填充)。用 setFillStroke() 设置矩形线条的颜色,如果没设置默认是黑色。
-     */
-    strokeRect(x: number, y: number, width: number, height: number): void;
-    /**
-     * 在给定的矩形区域内,清除画布上的像素
-     */
-    clearRect(x: number, y: number, width: number, height: number): void;
-    /**
-     * 对当前路径进行填充
-     */
-    fill(): void;
-    /**
-     * 对当前路径进行描边
-     */
-    stroke(): void;
-    /**
-     * 开始一个路径
-     */
-    beginPath(): void;
-    /**
-     * 关闭一个路径
-     */
-    closePath(): void;
-    /**
-     * 把路径移动到画布中的指定点,但不创建线条。
-     */
-    moveTo(x: number, y: number): void;
-    /**
-     * 添加一个新点,然后在画布中创建从该点到最后指定点的线条。
-     */
-    lineTo(x: number, y: number): void;
-    /**
-     * 添加一个弧形路径到当前路径,顺时针绘制。
-     */
-    arc(x: number, y: number, radius: number, startAngle: number, sweepAngle: number): void;
-    /**
-     * 创建二次方贝塞尔曲线
-     */
-    quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
-    /**
-     * 创建三次方贝塞尔曲线
-     */
-    bezierCurveTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): void;
-    /**
-     * 对横纵坐标进行缩放
-     */
-    scale(scaleWidth: number/**横坐标缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */, scaleHeight: number/**	纵坐标轴缩放的倍数1 = 100%,0.5 = 50%,2 = 200%,依次类 */): void;
-    /**
-     * 对坐标轴进行顺时针旋转
-     */
-    rotate(deg: number/**degrees * Math.PI/180;degrees范围为0~360;旋转角度,以弧度计 */): void;
-    /**
-     * 对坐标原点进行缩放
-     */
-    translate(x: number/**水平坐标平移量 */, y: number/**竖直坐标平移量 */): void;
-    /**
-     * 在画布上绘制被填充的文本
-     */
-    fillText(text: string, x: number, y: number): void;
-    /**
-     * 设置字体大小
-     */
-    setFontSize(fontSize: number): void;
-    /**
-     * 在画布上绘制图像
-     */
-    drawImage(imageResource: string, x: number, y: number, width: number, height: number): void;
-    /** 
-     * 设置全局画笔透明度。
-     */
-    setGlobalAlpha(alpha: number): void;
-    /**
-     * 保存当前坐标轴的缩放、旋转、平移信息
-     */
-    save(): void;
-    /**
-     * 恢复之前保存过的坐标轴的缩放、旋转、平移信息
-     */
-    restore(): void;
-    /**
-     * 进行绘图
-     */
-    draw(): void;
-}
-
-interface IAudioContext {
-    /**
-     * 播放 
-     */
-    play: () => void;	
-    /**
-     * 暂停 
-     */
-    pause: () => void;	
-    /**
-     * 跳转到指定位置,单位 s
-     */
-    seek: (position: number) => void;	
-}
-
-interface IVideoContext {
-    /**
-     * 播放 
-     */
-    play: () => void;	
-    /**
-     * 暂停 
-     */
-    pause: () => void;	
-    /**
-     * 跳转到指定位置,单位 s
-     */
-    seek: (position: number) => void;
-    /**
-     * 发送弹幕,danmu 包含两个属性 text, color。
-     */
-    sendDanmu: (danmu: {text: string; color: string;}) => void;
-}
-
-interface IMapContext {
-    /**
-     * 获取当前地图中心的经纬度,返回的是 gcj02 坐标系,可以用于 wx.openLocation
-     */
-    getCenterLocation: (obj: {
-        /** 
-         * 接口调用成功的回调函数 ,res = { longitude: "经度", latitude: "纬度"}
-         */
-        success?: (res: {longitude: string; latitude: string}) => void;
-        /**
-         * 接口调用失败的回调函数
-         */
-        fail?: () => void;
-        /** 
-         * 接口调用结束的回调函数(调用成功、失败都会执行)
-         */
-        complete?: () => void;
-    }) => void;
-    /**
-     * 将地图中心移动到当前定位点,需要配合map组件的show-location使用
-     */
-    moveToLocation: () => void;
-}
-
-interface Application {
-    setData: (obj: any) => void;
-}
-
-interface AppConstructor {
-    new (): Application;
-    (opts: {
-        /**
-         * 生命周期函数--监听小程序初始化
-         */
-        onLaunch?: () => void;
-        /**
-         * 生命周期函数--监听小程序显示
-         */
-        onShow?: () => void;
-        /**
-         * 生命周期函数--监听小程序隐藏
-         */
-        onHide?: () => void;
-
-        [key: string]: any;
-    }): Application;
-}
-
-declare var App: AppConstructor;
-declare function getApp(): Application;
-
-declare function getCurrentPages(): Page[];
-
-interface Page {
-    setData: (obj: any) => void;
-}
-
-interface PageConstructor {
-    new (): Page;
-    (opts: {
-        /**
-         * 页面的初始数据
-         */
-        data?: any;
-        /**
-         * 页面的初始数据
-         */
-        onLoad?: () => void;
-        /**
-         * 生命周期函数--监听页面初次渲染完成
-         */
-        onReady?: () => void;
-        /**
-         * 生命周期函数--监听页面显示
-         */
-        onShow?: () => void;
-        /**
-         * 生命周期函数--监听页面隐藏
-         */
-        onHide?: () => void;
-        /**
-         * 生命周期函数--监听页面卸载
-         */
-        onUnload?: () => void;
-        /**
-         * 页面相关事件处理函数--监听用户下拉动作
-         */
-        onPullDownRefreash?: () => void;
-        /**
-         * 页面上拉触底事件的处理函数
-         */
-        onReachBottom?: () => void;
-        /**
-         * 用户点击右上角分享
-         */
-        onShareAppMessage?: () => {
-            /**
-             * 分享标题, 默认值当前小程序名称
-             */
-            title: string;
-            /**
-             * 分享描述, 默认值当前小程序名称
-             */
-            desc: string;
-            /**
-             * 分享路径	默认值当前页面 path ,必须是以 / 开头的完整路径
-             */
-            path: string;
-        };	
-
-        [key: string]: any;
-    }): Page;
-}
-
-declare var Page: PageConstructor;
-
-declare var wx: {
-    // # 网络 # 
-    
-    request(obj: {
-        /**
-         * 开发者服务器接口地址
-         */
-        url: string;
-        /**
-         * 请求的参数
-         */
-        data?: any | string;
-        /**
-         * 设置请求的 header , header 中不能设置 Referer
-         */
-        header?: any;
-        /**
-         * 默认为 GET,有效值:OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
-         */
-        method?: string;
-        /**
-         * 默认为 json。如果设置了 dataType 为 json,则会尝试对响应的数据做一次 JSON.parse
-         */
-        dataType?: string;
-        /**
-         * 收到开发者服务成功返回的回调函数,res = {data: '开发者服务器返回的内容'}
-         */
-        success?: Function;
-        /**
-         * 接口调用失败的回调函数
-         */
-        fail?: Function;
-        /**
-         * 接口调用结束的回调函数(调用成功、失败都会执行)
-         */
-        complete?: Function;
-    }): void;
-                    
-    /**
-     * 将本地资源上传到开发者服务器。如页面通过 wx.chooseImage 等接口获取到一个本地资源的临时文件路径后,可通过此接口将本地资源上传到指定服务器。客户端发起一个 HTTPS POST 请求,其中 content-type 为 multipart/form-data 。
-     */
-    uploadFile(obj: {
-        /**
-         * 开发者服务器 url
-         */
-        url: string;
-        /**
-         * 要上传文件资源的路径
-         */
-        filePath: string;
-        /**
-         * 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容
-         */
-        name: string;
-        /**
-         * HTTP 请求 Header , header 中不能设置 Referer
-         */
-        header?: any;
-        /**
-         * HTTP 请求中其他额外的 form data
-         */
-        formData?: any;
-        /**
-         * 接口调用成功的回调函数
-         */
-        success?: Function;
-        /**
-         * 接口调用失败的回调函数
-         */
-        fail?: Function;
-        /**
-         * 接口调用结束的回调函数(调用成功、失败都会执行)
-         */
-        complete?: Function;
-    }): void;
-                    
-    /**
-     * 下载文件资源到本地。客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。
-     */
-    downloadFile(obj: {
-        /**
-         * 下载资源的 url
-         */
-        url: string;
-        /**
-         * HTTP 请求 Header
-         */
-        header?: any;
-        /**
-         * 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'}
-         */
-        success?: Function;
-        /**
-         * 接口调用失败的回调函数
-         */
-        fail?: Function;
-        /**
-         * 接口调用结束的回调函数(调用成功、失败都会执行)
-         */
-        complete?: Function;
-    }): void;
-                    
     /**
      * 创建一个 WebSocket 连接;一个微信小程序同时只能有一个 WebSocket 连接,如果当前已存在一个 WebSocket 连接,会自动关闭该连接,并重新创建一个 WebSocket 连接。
      */