柒零 преди 1 година
родител
ревизия
fed3cda52b

+ 17 - 52
@vant/weapp/calendar/calendar.wxml

@@ -1,65 +1,30 @@
 <view class="van-calendar">
-  <header
-    title="{{ title }}"
-    showTitle="{{ showTitle }}"
-    subtitle="{{ subtitle }}"
-    showSubtitle="{{ showSubtitle }}"
-  >
+  <header title="{{ title }}" showTitle="{{ showTitle }}" subtitle="{{ subtitle }}" showSubtitle="{{ showSubtitle }}">
     <slot name="title" slot="title"></slot>
   </header>
 
-  <scroll-view
-    class="van-calendar__body"
-    scroll-y
-    scroll-into-view="{{ scrollIntoView }}"
-  >
-    <month
-      wx:for="{{ computed.getMonths(minDate, maxDate) }}"
-      wx:key="index"
-      id="month{{ index }}"
-      class="month"
-      data-date="{{ item }}"
-      date="{{ item }}"
-      type="{{ type }}"
-      color="{{ color }}"
-      minDate="{{ minDate }}"
-      maxDate="{{ maxDate }}"
-      showMark="{{ showMark }}"
-      formatter="{{ formatter }}"
-      rowHeight="{{ rowHeight }}"
-      currentDate="{{ currentDate }}"
-      showSubtitle="{{ showSubtitle }}"
-      allowSameDay="{{ allowSameDay }}"
-      showMonthTitle="{{ index !== 0 || !showSubtitle }}"
-      bind:click="onClickDay"
-    />
+  <scroll-view class="van-calendar__body" scroll-y scroll-into-view="{{ scrollIntoView }}">
+    <month wx:for="{{ computed.getMonths(minDate, maxDate) }}" wx:key="index" id="month{{ index }}" class="month"
+      data-date="{{ item }}" date="{{ item }}" type="{{ type }}" color="{{ color }}" minDate="{{ minDate }}"
+      maxDate="{{ maxDate }}" showMark="{{ showMark }}" formatter="{{ formatter }}" rowHeight="{{ rowHeight }}"
+      currentDate="{{ currentDate }}" showSubtitle="{{ showSubtitle }}" allowSameDay="{{ allowSameDay }}"
+      showMonthTitle="{{ index !== 0 || !showSubtitle }}" bind:click="onClickDay" />
   </scroll-view>
 
-  <view
-    class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
-  >
+  <view class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}">
     <slot name="footer"></slot>
   </view>
 
-  <view
-    class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
-  >
-    <van-button
-      wx:if="{{ showConfirm }}"
-      round
-      block
-      type="danger"
-      color="{{ color }}"
-      custom-class="van-calendar__confirm"
-      disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
-      nativeType="text"
-      bind:click="onConfirm"
-    >
+  <view class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}">
+    <van-button wx:if="{{ showConfirm }}" round block type="default"
+      color="{{ 'linear-gradient( 315deg, #0ABCA4 0%, rgba(11,195,170,0.8) 100%)' }}"
+      custom-class="van-calendar__confirm" disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
+      nativeType="text" bind:click="onConfirm">
       {{
-        computed.getButtonDisabled(type, currentDate)
-          ? confirmDisabledText
-          : confirmText
+      computed.getButtonDisabled(type, currentDate)
+      ? confirmDisabledText
+      : confirmText
       }}
     </van-button>
   </view>
-</view>
+</view>

+ 3 - 3
@vant/weapp/calendar/components/month/index.js

@@ -143,13 +143,13 @@ VantComponent({
     getBottomInfo(type) {
       if (this.data.type === 'range') {
         if (type === 'start') {
-          return '开始';
+          return '入住';
         }
         if (type === 'end') {
-          return '结束';
+          return '离店';
         }
         if (type === 'start-end') {
-          return '开始/结束';
+          return '入住/离店';
         }
       }
     },

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
@vant/weapp/calendar/components/month/index.wxss


+ 5 - 2
@vant/weapp/calendar/index.js

@@ -16,7 +16,7 @@ VantComponent({
   props: {
     title: {
       type: String,
-      value: '日期选择',
+      value: '选择日期',
     },
     color: String,
     show: {
@@ -42,7 +42,10 @@ VantComponent({
       },
     },
     allowSameDay: Boolean,
-    confirmDisabledText: String,
+    confirmDisabledText: {
+      type: String,
+      value: '确定',
+    },
     type: {
       type: String,
       value: 'single',

+ 2 - 1
@vant/weapp/calendar/index.wxs

@@ -21,7 +21,8 @@ function getButtonDisabled(type, currentDate) {
   }
 
   if (type === 'range') {
-    return !currentDate[0] || !currentDate[1];
+    // return !currentDate[0] || !currentDate[1];
+    return !currentDate[0];
   }
 
   if (type === 'multiple') {

+ 66 - 1
@vant/weapp/calendar/index.wxss

@@ -1 +1,66 @@
-@import '../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{-webkit-flex-shrink:0;flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important}
+@import '../common/index.wxss';
+
+.van-calendar {
+    display: -webkit-flex;
+    display: flex;
+    -webkit-flex-direction: column;
+    flex-direction: column;
+    height: 100%;
+    height: var(--calendar-height, 100%);
+    background-color: #fff;
+    background-color: var(--calendar-background-color, #fff)
+}
+
+.van-calendar__close-icon {
+    top: 11px
+}
+
+.van-calendar__popup--bottom,
+.van-calendar__popup--top {
+    height: 80%;
+    height: var(--calendar-popup-height, 80%)
+}
+
+.van-calendar__popup--left,
+.van-calendar__popup--right {
+    height: 100%
+}
+
+.van-calendar__body {
+    -webkit-flex: 1;
+    flex: 1;
+    overflow: auto;
+    -webkit-overflow-scrolling: touch
+}
+
+.van-calendar__footer {
+    -webkit-flex-shrink: 0;
+    flex-shrink: 0;
+    padding: 0 16px;
+    padding: 0 var(--padding-md, 16px);
+    margin-left: 30px;
+    margin-right: 30px;
+    margin-bottom: 200rpx;
+}
+
+.van-calendar__footer--safe-area-inset-bottom {
+    padding-bottom: env(safe-area-inset-bottom)
+}
+
+.van-calendar__footer+.van-calendar__footer,
+.van-calendar__footer:empty {
+    display: none
+}
+
+.van-calendar__footer:empty+.van-calendar__footer {
+    display: block !important
+}
+
+.van-calendar__confirm {
+    height: 36px !important;
+    height: var(--calendar-confirm-button-height, 36px) !important;
+    margin: 7px 0 !important;
+    margin: var(--calendar-confirm-button-margin, 7px 0) !important;
+    line-height: 34px !important;
+    line-height: var(--calendar-confirm-button-line-height, 34px) !important
+}

+ 26 - 0
app.js

@@ -29,6 +29,32 @@ App({
               wx.setStorageSync("token", loginRes.data.token);
               wx.setStorageSync("unionid", loginRes.data.unionid);
 
+
+              wx.request({
+                url: `${homeApi_empower}/wxstatus`,
+                data: {
+                  unionid: wx.getStorageSync('unionid'),
+                  openid: wx.getStorageSync('openid'),
+                  token: wx.getStorageSync('token') || token_empower,
+                },
+                method: 'POST',
+                success: function (intervalRes) {
+                  console.log('intervalRes=' + JSON.stringify(intervalRes));
+                  console.log('intervalRes.data=' + JSON.stringify(intervalRes.data));
+                  //empower.js? [sm]:152 intervalRes.data={"st":"success","status":"0"}
+                  if (intervalRes.data && intervalRes.data.st && intervalRes.data.status && intervalRes.data.st == 'success' && intervalRes.data.status == '1') {
+                    wx.setStorageSync('hasAuth', true);
+                    wx.setStorageSync('hotelEmpower', intervalRes.data.hotel);
+                    wx.setStorageSync('roomEmpower', intervalRes.data.room);
+                  } else {
+                    wx.setStorageSync('hasAuth', false);
+                  }
+                },
+                fail: function (error) {
+
+                }
+              });
+
             }
           }
         })

+ 5 - 3
app.json

@@ -2,15 +2,16 @@
   "pages": [
     "pages/index/index",
     "pages/scan/scan",
-    "pages/data/data",
     "pages/shop/shop",
-    "pages/mine/mine"
+    "pages/mine/mine",
+    "pages/sleepReport/sleepReport"
   ],
   "subpackages": [
     {
       "root": "subpages",
       "name": "subpages",
       "pages": [
+        "data/data",
         "testSAS/testSAS",
         "sleepEvaluation/sleepEvaluation",
         "sleepQualityIndexAssessment/sleepQualityIndexAssessment",
@@ -71,7 +72,7 @@
         "selectedIconPath": "static/tabs/report-active@2x.png"
       },
       {
-        "pagePath": "pages/data/data",
+        "pagePath": "pages/sleepReport/sleepReport",
         "text": "睡眠报告",
         "iconPath": "static/tabs/report@2x.png",
         "selectedIconPath": "static/tabs/report-active@2x.png"
@@ -85,6 +86,7 @@
     ]
   },
   "usingComponents": {
+    "van-calendar": "@vant/weapp/calendar/index",
     "van-loading": "@vant/weapp/loading/index",
     "van-tab": "@vant/weapp/tab/index",
     "van-tabs": "@vant/weapp/tabs/index",

+ 1 - 1
componets/authorized-login-dialog/authorizedLoginDialog.wxml

@@ -13,7 +13,7 @@
         <button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
             <image class="avatar" src="{{avatarUrl}}" mode="widthFix"></image>
         </button>
-        <input type="nickname" class="nickname-input" placeholder="请输入昵称" bind:change="onInputNameChange"
+        <input type="nickname" class="nickname-input" placeholder="请输入昵称" bind:change="onInputNameChange" maxlength="8"
             placeholder-style="color: #888888;" value="{{nickName}}" />
 
         <button wx:if="{{!phoneNumber.length}}" open-type="getPhoneNumber" class="custom-input-button"

+ 1 - 1
custom-tab-bar/index.js

@@ -16,7 +16,7 @@ Component({
       "selectedIconPath": "/static/tabs/report-active@2x.png"
     },
     {
-      "pagePath": "/pages/data/data",
+      "pagePath": "/pages/sleepReport/sleepReport",
       "text": "睡眠报告",
       "iconPath": "/static/tabs/report@2x.png",
       "selectedIconPath": "/static/tabs/report-active@2x.png"

+ 1 - 0
pages/index/index.js

@@ -3909,6 +3909,7 @@ Page({
 		this.showData();
 	},
 	showData() {
+		const that = this;
 		if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
 			wx.showModal({
 				title: '提示',

+ 66 - 0
pages/main/main.js

@@ -0,0 +1,66 @@
+// pages/main/main.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 7 - 0
pages/main/main.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {},
+  "navigationBarRightButton": {
+    "hide": true
+  },
+  "navigationStyle": "custom"
+}

+ 4 - 0
pages/main/main.wxml

@@ -0,0 +1,4 @@
+<!--pages/main/main.wxml-->
+<view>
+
+</view>

+ 1 - 0
pages/main/main.wxss

@@ -0,0 +1 @@
+/* pages/main/main.wxss */

+ 229 - 0
pages/sleepReport/sleepReport.js

@@ -0,0 +1,229 @@
+// pages/sleepReport/sleepReport.js
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    page: 1,
+    show: false,
+    minDate: new Date(2024, 4, 1).getTime(),
+    maxDate: new Date().getTime(),
+    defaultDate: [new Date().getTime(), new Date().getTime()],
+    mData: [],
+    formatter(day) {
+      const month = day.date.getMonth() + 1;
+      const date = day.date.getDate();
+
+      if (month === 5) {
+        if (date === 1) {
+          day.topInfo = '劳动节';
+        } else if (date === 4) {
+          day.topInfo = '五四青年节';
+        } else if (date === 11) {
+          day.text = '今天';
+        }
+      }
+
+      if (day.type === 'start') {
+        day.bottomInfo = '入住';
+      } else if (day.type === 'end') {
+        day.bottomInfo = '离店';
+      }
+      // else if (day.type === 'start-end') {
+      //   return '入住/离店';
+      // }
+
+      return day;
+    },
+  },
+
+  onDisplay() {
+    this.setData({ show: true });
+  },
+  onClose() {
+    this.setData({ show: false });
+  },
+  // formatDate(date) {
+  //   date = new Date(date);
+  //   return `${date.getMonth() + 1}/${date.getDate()}`;
+  // },
+  formatDate(date) {
+    if (!date || date == null) {
+      return "";
+    }
+    date = new Date(date);
+    let year = date.getFullYear();
+    let month = (date.getMonth() + 1).toString().padStart(2, '0'); // 月份是从0开始的,所以要+1  
+    let day = date.getDate().toString().padStart(2, '0');
+    return `${year}-${month}-${day}`;
+  },
+
+  onConfirm(event) {
+    console.log(event.detail);
+    var dateArr = event.detail || [];
+    if (!dateArr[1] || dateArr[1] == null) {
+      console.log("单选");
+    } else {
+      console.log("多选");
+    }
+    this.setData({
+      show: false,
+      page: 1,
+      startdateStr: this.formatDate(event.detail[0]),
+      enddateStr: this.formatDate(event.detail[1]),
+    });
+    this.getList(this.data.startdateStr, this.data.enddateStr || this.data.startdateStr);
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+    this.getList()
+  },
+  toDetails(e) {
+    console.log(e.currentTarget.dataset.item);
+    let item = e.currentTarget.dataset.item;
+    wx.navigateTo({
+      url: `/subpages/data/data?rpids=${item.rpids}`
+    })
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+    const app = getApp();
+    app.globalData.selectedTabIndex = 2;
+    this.getTabBar().setData({
+      selected: 2
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+    this.setData({
+      page: 1
+    })
+    this.getList();
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+    console.log("上拉加载更多");
+    var page = this.data.page;
+    page += 1;
+    this.setData({
+      page: page
+    })
+    this.getList();
+
+  },
+  checkTime(timeStr) {
+    let hours = 0;
+    let minutes = 0;
+    if (timeStr && timeStr.indexOf("小时") != -1) {
+      let parts = timeStr.split("小时");
+      hours = parseInt(parts[0], 10); // 将小时部分转换为整数
+    }
+    if (timeStr && timeStr.indexOf("分钟") != -1) {
+      let parts = timeStr.split("小时");
+      let minutesStr = parts[1].split("分钟")[0]; // 获取分钟部分的字符串
+      minutes = parseInt(minutesStr, 10); // 将分钟部分转换为整数
+    }
+    console.log("小时:", hours); // 输出小时
+    console.log("分钟:", minutes); // 输出分钟
+    return {
+      hours: hours || 0,
+      minutes: minutes || 0
+    }
+  },
+  getList(startdateStr, enddateStr) {
+    const that = this;
+    wx.request({
+      url: 'https://aipush.aidsleep.cn/srpwithrange',
+      method: 'POST',
+      data: {
+        startdate: startdateStr,
+        enddate: enddateStr,
+        token: "89835e65993fee4a6a6cbbe4c271da51e5521822934e13769e61cadabaed72c3" || wx.getStorageSync('token'),
+        udi: wx.getStorageSync('unionid'),
+        pg: that.data.page,
+        lm: 20
+      },
+      success: (res) => {
+
+        var mDataTemp = that.data.mData || [];
+        var loadData = res.data.data;
+
+        if (res.data.data) {
+          for (const key in loadData) {
+            if (Object.prototype.hasOwnProperty.call(loadData, key)) {
+              const element = loadData[key];
+              let subItems = [];
+              for (const k in element) {
+                if (Object.prototype.hasOwnProperty.call(element, k)) {
+                  const subElement = element[k];
+                  for (let i = 0; i < subElement.length; i++) {
+                    var item = subElement[i];
+                    var dateItem = that.checkTime(item.rinbed_duration);
+                    item.hours = dateItem.hours;
+                    item.minutes = dateItem.minutes;
+                  }
+                  subItems = subItems.concat(subElement);
+                }
+              }
+              var data = {
+                dateTitle: key,
+                subItem: subItems
+              }
+              mDataTemp.push(data)
+            }
+          }
+          console.log(mDataTemp);
+          that.setData({
+            mData: mDataTemp
+          })
+
+        } else {
+        }
+      },
+      fail: () => {
+      }
+    });
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 7 - 0
pages/sleepReport/sleepReport.json

@@ -0,0 +1,7 @@
+{
+  "usingComponents": {
+  },
+  "navigationBarBackgroundColor": "#ffffff",
+  "navigationBarTextStyle": "black",
+  "navigationBarTitleText": "睡眠报告"
+}

+ 37 - 0
pages/sleepReport/sleepReport.wxml

@@ -0,0 +1,37 @@
+<!--pages/sleepReport/sleepReport.wxml-->
+<view class="content">
+    <view class="big-item" wx:for="{{mData}}" wx:key="index">
+        <text class="date-title">{{item.dateTitle}}</text>
+        <view class="sub-item" wx:for="{{item.subItem}}" wx:for-item="subItem" wx:for-index="subIndex" wx:key="subIndex"
+            data-item="{{subItem}}" bindtap="toDetails">
+            <view class="h-view" style="height: 80rpx;border-bottom: 1rpx solid #EEEEEE;">
+                <image class="icon" src="/static/images/report/ic_smbg.png"></image>
+                <text class="sub-time">{{subItem.rdate}}</text>
+                <text class="name">{{subItem.hn}} | {{subItem.pos}}</text>
+            </view>
+            <view class="h-view" style="justify-content: space-around;">
+
+                <view class="v-item">
+                    <text class="t1">{{subItem.durations}}</text>
+                    <text class="desc">睡眠时间</text>
+                </view>
+                <view class="v-item">
+                    <text class="t3">{{subItem.rscore_value}}</text>
+                    <text class="desc">香睡指数</text>
+                </view>
+                <view class="v-item">
+                    <text class="t1">{{subItem.hours}}<text class="t2">小时</text>{{subItem.minutes}}<text
+                            class="t2">分</text></text>
+                    <text class="desc">在床时间</text>
+                </view>
+
+            </view>
+        </view>
+    </view>
+    <text class="select_date_btn" bindtap="onDisplay">选择日期</text>
+
+    <van-calendar show="{{ show }}" type="range" min-date="{{ minDate }}" defaultDate="{{defaultDate}}"
+        max-date="{{ maxDate }}" allow-same-day="{{true}}" formatter="{{ formatter }}" color="#0ABCA4"
+        bind:close="onClose" bind:confirm="onConfirm" />
+
+</view>

+ 103 - 0
pages/sleepReport/sleepReport.wxss

@@ -0,0 +1,103 @@
+/* pages/sleepReport/sleepReport.wxss */
+.content {
+    width: 100vw;
+    display: flex;
+    flex-direction: column;
+    padding-top: 30rpx;
+    position: relative;
+    padding-bottom: 200rpx;
+}
+
+.big-item {
+    width: 100%;
+    display: flex;
+    margin-bottom: 36rpx;
+    align-items: center;
+    flex-direction: column;
+}
+
+.select_date_btn {
+    background: #FFFFFF;
+    color: #0BC3AA;
+    border: 1rpx solid #0BC3AA;
+    font-size: 24rpx;
+    position: absolute;
+    right: 36rpx;
+    top: 30rpx;
+    border-radius: 30rpx;
+    padding: 6rpx 18rpx;
+}
+
+.date-title {
+    width: calc(100% - 36rpx);
+    color: #333333;
+    margin-left: 36rpx;
+    top: 36rpx;
+    font-size: 32rpx;
+}
+
+.sub-item {
+    width: 690rpx;
+    margin-top: 32rpx;
+    box-shadow: 0rpx 8rpx 20rpx 0rpx #F1F1F1;
+    border-radius: 24rpx;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+}
+
+.h-view {
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    width: calc(100% - 60rpx);
+}
+
+.icon {
+    width: 28rpx;
+    height: 28rpx;
+}
+
+.sub-time {
+    flex: 1;
+    color: #666666;
+    margin-left: 16rpx;
+    font-size: 24rpx;
+}
+
+.name {
+    font-size: 24rpx;
+    color: #333333;
+}
+
+.v-item {
+    display: flex;
+    height: 190rpx;
+    justify-content: center;
+    flex-direction: column;
+    align-items: center;
+}
+
+.t1 {
+    font-size: 32rpx;
+    font-weight: 700;
+    color: #333333;
+}
+
+.t2 {
+    font-weight: 400;
+    font-size: 24rpx;
+    color: #333333;
+}
+
+.t3 {
+    font-size: 32rpx;
+    font-weight: 700;
+    color: #0BC3AA;
+}
+
+.desc {
+    margin-top: 12rpx;
+    color: #888888;
+    font-size: 24rpx;
+}

+ 1 - 75
project.private.config.json

@@ -7,80 +7,6 @@
     "preloadBackgroundData": false
   },
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "condition": {
-    "miniprogram": {
-      "list": [
-        {
-          "name": "pages/mine/mine",
-          "pathName": "pages/mine/mine",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "subpages/testSAS/testSAS",
-          "pathName": "subpages/testSAS/testSAS",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "subpages/sleepEvaluation/sleepEvaluation",
-          "pathName": "subpages/sleepEvaluation/sleepEvaluation",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment",
-          "pathName": "subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment",
-          "pathName": "subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "subpages/sleepEvaluation/sleepEvaluation",
-          "pathName": "subpages/sleepEvaluation/sleepEvaluation",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "pages/data/data",
-          "pathName": "pages/data/data",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "pages/scan/scan",
-          "pathName": "pages/scan/scan",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "pages/index/index",
-          "pathName": "pages/index/index",
-          "query": "",
-          "scene": null
-        },
-        {
-          "name": "",
-          "pathName": "pages/shop/shop",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        }
-      ]
-    }
-  },
+  "condition": {},
   "libVersion": "3.5.6"
 }

BIN
static/images/report/ic_smbg.png


+ 71 - 33
pages/data/data.js → subpages/data/data.js

@@ -21,8 +21,48 @@ let chartSnoringLine;//打鼾
 let chartApneaLine;//呼吸暂停
 let chartTimeWaterfall;//深浅睡眠
 
-// 圈圈
+// 圈圈>90分极好(绿色)
+// > 75分,(浅绿色)良好
+// 各项睡眠监测数据统计 > 60分,较差(黄色)
+// 	< 60分,很差(红色)
 function setChartCircularProgressBarOption(chart, data = {}) {
+	var rscore_value = data?.rscore_value || 0;
+	var checkList = [{
+		title: "极好",
+		titleColor: "#0BC3AA",
+		startColor: "#0AB1C3",
+		centerColor: "#0BC3AA",
+		endColor: "#36E1CA",
+	}, {
+		title: "良好",
+		titleColor: "#9C43FF",
+		startColor: "#8D25FF",
+		centerColor: "#A631FF",
+		endColor: "#FF8FF0",
+	}, {
+		title: "较差",
+		titleColor: "#FF8F4E",
+		startColor: "#EE8B52",
+		centerColor: "#FAA472",
+		endColor: "#FAA472",
+	}, {
+		title: "很差",
+		titleColor: "#FB717B",
+		startColor: "#FB717B",
+		centerColor: "#FB717B",
+		endColor: "#FF98A0",
+	}];
+	var checkData = checkList[0];
+	if (rscore_value >= 90 && rscore_value <= 100) {
+		checkData = checkList[0];
+	} else if (rscore_value >= 75 && rscore_value < 90) {
+		checkData = checkList[1];
+	} else if (rscore_value >= 60 && rscore_value < 75) {
+		checkData = checkList[2];
+	} else {
+		checkData = checkList[3];
+	}
+
 	var option = {
 		series: [
 			{
@@ -55,16 +95,16 @@ function setChartCircularProgressBarOption(chart, data = {}) {
 							colorStops: [
 								{
 									offset: 0,
-									color: '#8D25FF' // 0% 处的颜色
+									color: checkData.startColor // 0% 处的颜色
 								},
 
 								{
 									offset: 0.5,
-									color: '#A631FF' // 100% 处的颜色
+									color: checkData.centerColor // 100% 处的颜色
 								},
 								{
 									offset: 1,
-									color: '#FF8FF0' // 100% 处的颜色
+									color: checkData.endColor // 100% 处的颜色
 								}
 							],
 							global: false // 缺省为 false
@@ -90,7 +130,7 @@ function setChartCircularProgressBarOption(chart, data = {}) {
 					show: false,
 				},
 				title: {
-					color: '#6C6970',
+					color: checkData.titleColor,
 					offsetCenter: [0, '-36%'],
 					lineHeight: 15,
 					fontSize: 15,
@@ -110,13 +150,13 @@ function setChartCircularProgressBarOption(chart, data = {}) {
 						value: {
 							fontSize: 30,
 							fontWeight: 'bolder',
-							color: '#333333'
+							color: checkData.titleColor
 						},
 					}
 				},
 				data: [
 					{
-						name: data?.rscore_desc || '无',
+						name: data?.rscore_desc || checkData.title || '无',
 						value: data?.rscore_value || 0
 					}
 				]
@@ -731,8 +771,6 @@ function setSnoringOption(chart, data1 = [], data2 = [],) {
 		},
 		yAxis: {
 			type: 'value',
-			max: 24,
-			min: 0,
 			show: false,
 		},
 		series: [{
@@ -849,8 +887,6 @@ function setApneaOption(chart, data1 = [], data2 = [],) {
 		},
 		yAxis: {
 			type: 'value',
-			max: 24,
-			min: 0,
 			show: false,
 		},
 		series: [{
@@ -922,7 +958,7 @@ function renderItem(params, api) {
 		api.value(1) + (api.value(2) - api.value(1)) / 2,
 		categoryIndex
 	])[1]; // 取中间点的y坐标
-	var height =  api.size([0, 1])[1] * 0.6;
+	var height = api.size([0, 1])[1] * 1;
 	var width = endX - startX;
 
 	// 创建一个矩形
@@ -964,7 +1000,7 @@ function setTimeWaterfallOption(chart, startTime = new Date().getTime(), data =
 	var option =
 		option = {
 			tooltip: {
-				show:true,
+				show: true,
 				formatter: function (params) {
 					return params.marker + params.name + ': ' + params.value[3] + ' m';
 				}
@@ -978,11 +1014,11 @@ function setTimeWaterfallOption(chart, startTime = new Date().getTime(), data =
 			grid: {
 				top: 0,
 				bottom: 0,
-				height:210,
+				height: 160,
 				containLabel: false
 			},
 			xAxis: {
-				type: 'value',  
+				type: 'value',
 				scale: true,
 				splitLine: {
 					show: false // 是否显示刻度线
@@ -2011,7 +2047,7 @@ Page({
 			// onInit: initChartTimeWaterfall
 		},
 		header: false,
-		showAuthorizedDialog:false,
+		showAuthorizedDialog: false,
 		nowDate: [{ //日历的初始化数据
 			month: 'current',
 			day: new Date().getDate(),
@@ -2841,7 +2877,7 @@ Page({
 										// console.log('ress.data.results.rin_duration=' + ress.data.results.rin_duration);
 										// console.log('ress.data.results.rawake_duration=' + ress.data.results.rawake_duration);
 
-
+										// initChartTimeWaterfall();
 										that.calculateTheDurationOfDeepSleep();
 										// updateTimeWaterfall([that.convertTimeToHoursAndMinutes(ress.data.results.rawake_duration, 2),
 										// 	that.convertTimeToHoursAndMinutes(ress.data.results.rin_duration, 2),
@@ -4267,10 +4303,10 @@ Page({
 		// 初始化变量  reportDate
 		// let dateString = '2024/09/14 23:20:00';
 		let dateString = `${that.data.reportDate.replaceAll("-", "/")} ${that.data.rgobed_time + ":00"}`;
-		let date = new Date(dateString); 
+		let date = new Date(dateString);
 		let startTime = date.getTime(); // 基准时间,这里设为午夜开始 
 		console.log("时间=》", timestampToHHMM(startTime));
-		
+
 		let currentTime = startTime;
 		let currentState = sleepData[0];
 		let timePeriods = [];
@@ -4349,11 +4385,11 @@ Page({
 			this.showData();
 		}
 	},
-	showData() { 
-		let userInfo = wx.getStorageSync("userInfo") || {};
-		let hotelcodeTemp = userInfo.hotel;
-		let roomcodeTemp = userInfo.room;
-
+	showData() {
+		let hotelcodeTemp = wx.getStorageSync("hotelEmpower");
+		let roomcodeTemp = wx.getStorageSync("roomEmpower");
+		// hotelcodeTemp = wx.getStorageSync('res').result.split('|')[0];
+		// roomcodeTemp = wx.getStorageSync('res').result.split('|')[1];
 		this.getData(null, hotelcodeTemp, roomcodeTemp, null);
 		// 设置canvas的宽高  
 		this.setData({
@@ -4373,12 +4409,7 @@ Page({
 	/**			
 	 * 生命周期函数--监听页面加载
 	 */
-	onShow: function (options) {
-		const app = getApp();
-		app.globalData.selectedTabIndex = 2;
-		this.getTabBar().setData({
-			selected: 2
-		})
+	onShow: function () {
 		var that = this;
 		console.log("that.data.month + 1", that.data.month + 1)
 		var clickDate = String(that.data.year) + String(that.data.month) + String(that.data.date)
@@ -4391,13 +4422,20 @@ Page({
 
 
 
+
 	},
-	onLoad(option) {
+	onLoad(options) {
+		var that = this;
+		if (options.rpids) {
+			that.setData({
+				reportId: options.rpids
+			})
+		}
 		// var that = this;
 		// console.log("data页面");
 		// wx.clearStorage();
 		// console.log('option.res=' + JSON.stringify(wx.getStorageSync('res')));
-		
+
 		// if (!wx.getStorageSync('res') || !wx.getStorageSync('res').result) {
 		// 	wx.showModal({
 		// 		title: '提示',
@@ -4424,7 +4462,7 @@ Page({
 		// 		})
 		// 	}, 2000) // 设置延时时间,单位为毫秒
 		// }
-	
+
 
 		// else if(!this.data.home_room.includes(wx.getStorageSync('res').result)){
 		// 	  wx.showModal({

+ 0 - 0
pages/data/data.json → subpages/data/data.json


+ 1 - 1
pages/data/data.wxml → subpages/data/data.wxml

@@ -187,7 +187,7 @@
 
 		<view class="row_c3">
 			<view class="cell_c3">
-				<image class="image_c5" src="/static/images/report/shuimian_xiaolv_big_new.png" mode="widthFix" />
+				<image class="image_c5" src="/static/images/report/pingjun_huxilv_new.png" mode="widthFix" />
 				<view class="organize-dot-up" style="background: #FB717B;"></view>
 				<view class="cell-text_c3">
 					<view><text class="text-line_c3">平均呼吸率</text></view>

+ 3 - 3
pages/data/data.wxss → subpages/data/data.wxss

@@ -800,9 +800,9 @@ ec-canvas {
 }
 
 .text_c4_1 {
-  font-size: 32rpx;
+  font-size: 34rpx;
   color: #6E6AB2;
-  font-weight: 600;
+  font-weight: 700;
 }
 
 .text-line_c41 {
@@ -1154,7 +1154,7 @@ ec-canvas {
 .echarts-container_c6 {
   width: 100%;
   /* 可以根据需要调整 */
-  height: 480rpx;
+  height: 400rpx;
   /* 可以根据需要调整,或者设置为百分比 */
   display: flex;
   justify-content: center;

Някои файлове не бяха показани, защото твърде много файлове са промени