柒零 пре 1 година
родитељ
комит
4a639dcdd3

+ 1 - 1
project.private.config.json

@@ -75,5 +75,5 @@
       ]
     }
   },
-  "libVersion": "3.5.3"
+  "libVersion": "3.5.5"
 }

+ 2 - 1
subpages/sleepEvaluation/sleepEvaluation.js

@@ -26,7 +26,8 @@ Page({
 		noSatisfiedOptions: [
 			{ value: '0', label: '设备操作有困难' },
 			{ value: '1', label: '对睡眠帮助较小' },
-			{ value: '2', label: '其他原因(请详细说明)' },
+			{ value: '2', label: '都满意' },
+			{ value: '3', label: '其他原因(请详细说明)' },
 		],
 		career: '',
 		careerInput: '',

+ 3 - 1
subpages/sleepEvaluation/sleepEvaluation.wxml

@@ -1,5 +1,7 @@
 <view style="width: 100vw;height: 100vh; background: #CCEDF5;">
-  <scroll-view scroll-y="true" style="height: 100vh;background: #CCEDF5;" scroll-into-view="{{mInputId}}">
+  <scroll-view scroll-y="true"
+    style="height: 100vh;background: #CCEDF5;min-height: 100vh;overflow-x: hidden;overflow-y: auto;"
+    scroll-into-view="{{mInputId}}">
 
     <view class="container">
       <image src="/subpages/images/testb_banner.png" style="display: block;width: 100vw;" mode="widthFix"></image>

+ 34 - 8
subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment.js

@@ -19,7 +19,7 @@ Page({
 		answerJson: [],
 		columns: [[], []],
 		BMI: null, 
-		mInputId:"",
+		mInputScrollId:null,
 		weight: 0,
 		height: 0,
 		promptTextMessageFlag: false,//结果弹窗
@@ -27,8 +27,9 @@ Page({
 		privacyDetailShow: false,// 隐私条款弹出页是否显示  
 		changeValue: '',//
 		comScore: 0,
-		comScoreStatus: '', 
-		comScoreIndex:0,
+		comScoreStatus: '',
+		comScoreIndex: 0,
+		comScoreDesc: "如果你在这一级别内,那么你的睡眠质量可就亮起红灯了。你必须警惕,因为你的睡眠质量确实比较糟糕,健康状况明显受损。饮食起居会受到一定影响,甚至部分工作你都开始感觉吃力。",
 		ratingResultsList: [{
 			title: "非常好",
 			icon: "/subpages/icons/ic_triangle_down_1.svg",
@@ -96,7 +97,7 @@ Page({
 		for (let i = 0; i < oldJsonList.length; i++) {
 			const element = oldJsonList[i];
 			if (element.num == item.num) {
-				element['questionValue'] = event.detail;
+				element['questionValue'] = event.detail.value;
 				break;
 			}
 		}
@@ -105,6 +106,15 @@ Page({
 			qnaire: oldJsonList
 		});
 	},
+	onChangeFocus(event) {
+		const item = event.currentTarget.dataset.item
+		const that = this;
+		setTimeout(() => {
+			that.setData({
+				mInputScrollId: "item" + item.num
+			});
+		}, 200);
+	}, 
 	onChangePrivacy(event) {
 		const check = event.detail;
 
@@ -209,13 +219,13 @@ Page({
 		var finish = true;
 		var _this = this;
 		let oldJsonList = _this.data.qnaire;
-		var mInputId = "";
+		var mInputScrollId = null;
 		for (let i = 0; i < oldJsonList.length; i++) {
 			const element = oldJsonList[i];
 			if (!element.value) {
 				finish = false;
 				console.log("未完成的:", element.num);
-				mInputId = "item" + element.num;
+				mInputScrollId = "item" + element.num;
 				wx.showModal({
 					title: '无法提交',
 					content: '您还有部分题目未完成,请检查后重新提交',
@@ -224,7 +234,7 @@ Page({
 					confirmText: "好的",
 					success(res) {
 						_this.setData({
-							mInputId: mInputId
+							mInputScrollId: mInputScrollId
 						})
 					}
 				})
@@ -245,7 +255,7 @@ Page({
 				confirmText: "好的",
 				success(res) {
 					_this.setData({
-						mInputId: mInputId
+						mInputScrollId: mInputScrollId
 					})
 				}
 			})
@@ -402,6 +412,7 @@ Page({
 		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) {
@@ -415,14 +426,28 @@ Page({
 			comScoreIndex = 3;
 		}
 
+		if (this.judgmentScoreRange(comAll,0,3)) {
+			_comScoreDesc = "你目前的睡眠质量非常高,而且健康状况良好,这一切应该继续保持下去。"
+		} else if (this.judgmentScoreRange(comAll, 4, 8)) {
+			_comScoreDesc = "你的睡眠质量平平,健康状况也受到影响, 如果再不引起你对睡眠质量的足够重视, 那么你的睡眠质量很可能会迅速下降,向下一级别发展。"
+		} else if (this.judgmentScoreRange(comAll, 9, 16)) {
+			_comScoreDesc = "如果你在这一级别内,那么你的睡眠质量可 就亮起红灯了。你必须警惕,因为你的睡眠质量确实比较糟糕,健康状况明显受损。饮食起居会受到一定影响,甚至部分工作你都开始感觉吃力。"
+		} else {
+			_comScoreDesc = "天啊!你的睡眠质量已经到了令人发指的地 步—长期睡眠不足导致了你的健康状况严重恶化,这就是你工作力不从心,情绪起伏不定的原因。"
+		}
+
 		console.log('comAll=' + comAll + ',comScoreStatus=' + _comScoreStatus);
 		this.setData({
 			comScore: comAll,
 			comScoreStatus: _comScoreStatus,
 			comScoreIndex,
+			comScoreDesc: _comScoreDesc,
 			promptTextMessageFlag: true,
 		})
 	},
+	judgmentScoreRange(scoreValue, startScore, endScore) {
+		return scoreValue >= startScore && scoreValue <= endScore;
+	},
 	resultABCD: function (a) {
 		if (a == 'a') {
 			return 0;
@@ -515,6 +540,7 @@ Page({
 	 * 生命周期函数--监听页面加载
 	 */
 	onLoad: function (options) {
+		
 
 		let oldJsonList = qnaire.qnaire
 		oldJsonList.forEach(element => {

+ 9 - 4
subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment.wxml

@@ -1,7 +1,9 @@
 <!--miniprogram/pages/testSAS/testSAS.wxml-->
 
 <view style="width: 100vw;height: 100vh; background: #ECFAF7;">
-	<scroll-view scroll-y="true" style="height: 100vh;background: #ECFAF7;" scroll-into-view="{{mInputId}}">
+	<scroll-view scroll-y="true"
+		style="height: 100vh;background: #ECFAF7;min-height: 100vh;overflow-x: hidden;overflow-y: auto;"
+		scroll-into-view="{{mInputScrollId}}">
 		<view class='container'>
 			<image src="/subpages/images/test_banner.png" style="display: block;width: 100vw;" mode="widthFix"></image>
 			<view class="tips">
@@ -16,8 +18,10 @@
 				<view class="item-problem-input-view" wx:if="{{item.question_1 && item.type == 'radio&input'}}">
 					<text class="item-problem-input-title">{{item.question_1}}</text>
 					<view class="item-problem-input-line"></view>
-					<van-field class="item-problem-input" value="{{ item.questionValue }}" placeholder=""
-						border="{{ false }}" data-item="{{item}}" bind:change="onChangeInput" />
+					<!-- <van-field class="item-problem-input" value="{{ item.questionValue }}" placeholder=""
+						border="{{ false }}" data-item="{{item}}" bind:change="onChangeInput" /> -->
+					<input class="item-problem-input" value="{{ item.questionValue }}" placeholder=""
+						border="{{ false }}" data-item="{{item}}" bindblur="onChangeInput" />
 				</view>
 				<view wx:if="{{item.question_1}}" class="item-border"></view>
 				<view class="date-show-view" wx:if="{{item.question_1 && item.type == 'date'}}" data-item="{{item}}"
@@ -133,9 +137,10 @@
 								</view>
 								<text
 									class=" {{comScoreIndex == index ? 'resultsAreShown-content-score-desc.active' : 'resultsAreShown-content-score-desc'}}">{{item.title}}</text>
+
 							</view>
 						</view>
-
+						<text class="resultsAreShown-content-tips">{{comScoreDesc}}</text>
 					</view>
 
 					<van-icon name="close" size="56rpx" color="#FFFFFF" bindtap="onCloseResultsDialog" />

+ 6 - 1
subpages/sleepQualityIndexAssessment/sleepQualityIndexAssessment.wxss

@@ -340,7 +340,6 @@ page {
 .resultsAreShown-content-score-view {
   display: flex;
   flex-direction: row;
-  margin-bottom: 40rpx;
   margin-top: 22rpx;
   margin-left: 24rpx;
   align-items: center;
@@ -390,4 +389,10 @@ page {
   background: white;
   color: #5A5A5A;
   box-shadow: 4rpx 4rpx 0 #BAE2E0;
+}
+
+.resultsAreShown-content-tips {
+  color: #888888;
+  margin: 30rpx;
+  font-size: 20rpx;
 }